Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 10th, 2011, 10:24 PM
Registered User
 
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default PROGRAMMING APPEARANCE OF DROPDOWNLIST HOVER ITEMS

Hello everyone since i started studying this great text by Imar i try to come up with ideas i can implement on my own. I visited microsoft's "www.dreamspark.com" and at the top right of this website. There is a Language dropdownlist(change language) which changes color when the mouse hovers on any of the list items this color also matches the color of the dropdownlist button. You can do a quick visit of the site to understand what exactly i want to achieve. I tried out my own code but succeeded only in underling and changing to italics, when my mouse hovers on one of the items in the dropdown list. Kindly help.


Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Play.aspx.cs" Inherits="Play" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="~/Player/Play.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="banky">
    
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged" 
            ForeColor="Red" BackColor="White">
            <asp:ListItem ID="bibi" Selected="True" >English</asp:ListItem>
            <asp:ListItem ID="bib">France </asp:ListItem>
            <asp:ListItem>Nigeria</asp:ListItem>
            <asp:ListItem>Egypt</asp:ListItem>
            <asp:ListItem>United Kingdom</asp:ListItem>
            <asp:ListItem>Sudan</asp:ListItem>
            <asp:ListItem>United States</asp:ListItem>
            <asp:ListItem>Belguim</asp:ListItem>
        </asp:DropDownList>
    
    </div>
    </form>
</body>
</html>
CSS FILE
Code:
#bibi:hover, #bib:hover
{
    font-family: 'Times New Roman' , Times, serif;
    font-size: larger;
    font-style: italic;
    text-decoration: line-through;
}


Thanks
  #2 (permalink)  
Old February 11th, 2011, 05:07 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

For questions not related to my book directly, please choose a different category such as one of the JavaScript forum here at P2P. You'll get better answers there.

Anyway, looks like they used some jQuery to implement this. Not all browsers (esepcially older versions of IE) support :hover on elements other than the <a>.

It's not an easy thing to implement and requires some jQuery scripting and / or ready made plugins. You may want to start here:

http://stackoverflow.com/questions/2...option-element
http://www.google.com/#q=jQuery+hover+option+element

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdownlist Items Identification msbsam ASP.NET 2.0 Professional 1 August 18th, 2008 12:50 PM
DropDownList, DataSource and Selected Items kingroon ASP.NET 2.0 Basics 2 February 25th, 2008 10:41 AM
Finding items in a dropdownlist control johnnycorpse Classic ASP Components 0 May 18th, 2007 04:09 AM
Hover color of dropdown items toshi ASP.NET 1.0 and 1.1 Basics 0 May 3rd, 2006 04:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.