TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-28-2009, 12:36 AM   #1 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default Dropdown menu with icons?

hey guys,

looking to see if anyone knows how to do this. I've been seeing some site use dropdowns but along with the text, it also has icons.

The icons are usually small, I'd assume they were around 16x16 or maybe even 20x20, but does anyone know how to include images in a drop down? the format is below:

Dropdown Menu
-------------
[icon] Link#1
[icon] Link#2
[icon] Link#3
allworknoplay is offline  
Reply With Quote
Old 02-28-2009, 12:50 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
hey guys,

looking to see if anyone knows how to do this. I've been seeing some site use dropdowns but along with the text, it also has icons.

The icons are usually small, I'd assume they were around 16x16 or maybe even 20x20, but does anyone know how to include images in a drop down? the format is below:

Dropdown Menu
-------------
[icon] Link#1
[icon] Link#2
[icon] Link#3
What I do is get the mouse position, and just position the dropdown menu to the x and y corridinates of the mouses current position, which is also called events, then I check if its displayed or not, and change that, besides that the contents of the drop down element is formated the way it should be, and that's about it.

The icons are probably from FamFamFam
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
The Following User Says Thank You to Orc For This Useful Post:
allworknoplay (02-28-2009)
Old 02-28-2009, 12:59 AM   #3 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
What I do is get the mouse position, and just position the dropdown menu to the x and y corridinates of the mouses current position, which is also called events, then I check if its displayed or not, and change that, besides that the contents of the drop down element is formated the way it should be, and that's about it.

The icons are probably from FamFamFam
Ok you completely lost me, but I'm glad you sent me that link, I've never seen that site before but looking at it quickly looks like a fun site to scour around...

I'll be taking a look at it...thanks!
allworknoplay is offline  
Reply With Quote
Old 02-28-2009, 01:02 AM   #4 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
Ok you completely lost me, but I'm glad you sent me that link, I've never seen that site before but looking at it quickly looks like a fun site to scour around...

I'll be taking a look at it...thanks!
It's a site where you can get a large variety pack of icons.

WildHoney uses it on WiredFlame.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 02-28-2009, 01:08 AM   #5 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
It's a site where you can get a large variety pack of icons.

WildHoney uses it on WiredFlame.

I'm seeing a "UK" theme around here...is everyone from the UK?
allworknoplay is offline  
Reply With Quote
Old 02-28-2009, 01:15 AM   #6 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
I'm seeing a "UK" theme around here...is everyone from the UK?
I don't understand?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 02-28-2009, 01:17 AM   #7 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
I don't understand?
It's just a joke, it just seems like a lot of the members here are from the U.K.
allworknoplay is offline  
Reply With Quote
Old 02-28-2009, 01:55 AM   #8 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

It is as simple as the following code. Albeit Internet Explorer doesn't play so nicely so that would require more of a hack.

css Code:
select option
{
    background-repeat: no-repeat;
    background-position: 3px center;
    padding-left: 25px;
}

select option#ar { background-image: url('ar.gif'); }
select option#be { background-image: url('be.gif'); }
select option#en { background-image: url('en.gif'); }
select option#fr { background-image: url('fr.gif'); }

Using this HTML code:

html4strict Code:
<select>
    <option id="ar">Argentina</option>
    <option id="be">Belgium</option>
    <option id="en">England</option>
    <option id="fr">France</option>
</select>
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following User Says Thank You to Wildhoney For This Useful Post:
allworknoplay (02-28-2009)
Old 02-28-2009, 01:57 AM   #9 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

! Hehe. Yes, I think many of us are from the UK. Where are you from again?
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 02-28-2009, 02:01 AM   #10 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
It is as simple as the following code. Albeit Internet Explorer doesn't play so nicely so that would require more of a hack.

css Code:
select option
{
    background-repeat: no-repeat;
    background-position: 3px center;
    padding-left: 25px;
}

select option#ar { background-image: url('ar.gif'); }
select option#be { background-image: url('be.gif'); }
select option#en { background-image: url('en.gif'); }
select option#fr { background-image: url('fr.gif'); }

Using this HTML code:

html4strict Code:
<select>
    <option id="ar">Argentina</option>
    <option id="be">Belgium</option>
    <option id="en">England</option>
    <option id="fr">France</option>
</select>
I sooooo hate IE...it never plays nicely with anything!!

You have no idea how many times I design something, check it out in FF...wrap it up, call it a day, and say, "oops I forgot to try this in IE.."

Low and behold, it won't look right in IE....


Quote:
Originally Posted by Wildhoney View Post
! Hehe. Yes, I think many of us are from the UK. Where are you from again?
I am from New York....
allworknoplay is offline  
Reply With Quote
Old 02-28-2009, 02:03 AM   #11 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

BTW, thanks for the dropdown code, I will try it out tonite...
allworknoplay is offline  
Reply With Quote
Old 02-28-2009, 02:43 AM   #12 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

IE8 seems to get the standards right this time. ;p
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 03-14-2009, 05:16 PM   #13 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
IE8 seems to get the standards right this time. ;p
That may be, but what else will they introduce that will conflict with the so called "standards"....

It will forever be an ongoing battle between FF and IE.

It's always apples to oranges, oranges to apples....

Perhaps one day we'll finally just get apples to apples....
allworknoplay is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[DEV] free CSS Multi-level Menu Online Creator almsamim XHTML, HTML, CSS 4 11-29-2008 06:57 PM
Menu Display Problem in IE6+ obolus XHTML, HTML, CSS 14 03-01-2008 07:57 PM
Some help with dropdown menu Tanax Javascript, AJAX, E4X 2 02-18-2008 04:38 PM
My dynamic menu lesP Advanced PHP Programming 7 01-21-2008 10:28 PM
Menu using 2 js functions. Sam Granger Javascript, AJAX, E4X 0 11-15-2007 01:26 PM


All times are GMT. The time now is 07:53 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design