473,520 Members | 2,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

div:active not working in IE

Atli
5,058 Recognized Expert Expert
Hi.

I have this CSS:
Expand|Select|Wrap|Line Numbers
  1. div.FolderContainer
  2. {
  3.     background: #AFBFAF;
  4.     float: left;
  5.     width: 250px;
  6.     height: 74px;
  7.     border: solid 1px #556555;
  8.     margin: 3px;
  9.     overflow: auto;
  10. }
  11. div.FolderContainer:hover
  12. {
  13.     background: #BFCFBF;
  14. }
  15. div.FolderContainer:active
  16. {
  17.     background: #DFFFDF;
  18. }
  19.  
It's pretty simple, is just supposed to highlight the div on hover and flash it when it is clicked.

This works perfectly in Mozilla, but the :active part wont work in IE. It just stays the same as the :hover part.

Anybody know a way arround this?
May 26 '07 #1
6 19132
drhowarddrfine
7,435 Recognized Expert Expert
:hover does not work on anything but <a> in IE6 while modern browsers can handle anything. There are workarounds using javascript and other workarounds involving placing the <a> element around contents inside the div but it's specific to your application.
May 26 '07 #2
Atli
5,058 Recognized Expert Expert
:hover does not work on anything but <a> in IE6 while modern browsers can handle anything. There are workarounds using javascript and other workarounds involving placing the <a> element around contents inside the div but it's specific to your application.
Ahh, ok.
Weird that :active doesn't work in IE7 tho. I would have thought they'd have fixed it while they were fixing :hover.

Guess I'm gona have to mix in some javascript :(

Thanks for the help tho.
May 26 '07 #3
Atli
5,058 Recognized Expert Expert
Just thought I'd post my solution.
There are many solutions, but this way I wont have to put any part of my styles in the html markup.
And it works in IE5 and never :D (I've tested)

Expand|Select|Wrap|Line Numbers
  1. .TileContainer
  2. {
  3.     background: #AFBFAF;
  4.     float: left;
  5.     width: 250px;
  6.     height: 74px;
  7.     border: solid 1px #556555;
  8.     margin: 3px;
  9.     margin-left: 10px;    
  10.     cursor: pointer;
  11. }
  12. .TileContainerHover
  13. {
  14.     background: #BFCFBF;
  15.     float: left;
  16.     width: 250px;
  17.     height: 74px;
  18.     border: solid 1px #556555;
  19.     margin: 3px;
  20.     margin-left: 10px;    
  21.     cursor: pointer;
  22. }
  23. .TileContainerActive
  24. {
  25.     background: #DFFFDF;
  26.     float: left;
  27.     width: 250px;
  28.     height: 74px;
  29.     border: solid 1px #556555;
  30.     margin: 3px;
  31.     margin-left: 10px;    
  32.     cursor: pointer;
  33. }
  34.  
Expand|Select|Wrap|Line Numbers
  1. <div class="TileContainer" 
  2.     onmouseover="this.className='TileContainerHover'"
  3.     onmouseout="this.className='TileContainer'"
  4.     onmousedown="this.className='TileContainerActive'"
  5.     onmouseup="this.className='TileContainerHover'"
  6. >
  7. </div>
  8.  
May 26 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
Didn't look at the code because I'm cooking supper but :hover was fixed in IE7. I'll look at the rest in a minute.

Does anyone still use IE5?
May 26 '07 #5
Atli
5,058 Recognized Expert Expert
Does anyone still use IE5?
Yea, his name is Kalaallit and he lives in a lighthouse on a small isle outside of Greenland. He uses his lighthouse to morse the HTML markup from the mainland. Currently hi's IE6 download is at 53%, ETA Jan 2009.
May 27 '07 #6
dootzky
1 New Member
first of all -> solution works GREAT, even for fuc*ing IE..
i really HATE ie. if you hate it to, go here:

http://ie.jemjabella.com/

seriously.

and hacking your own code, just for sakes of stupid IE - is moronic.
but when you have to.. this is the good solution.

and the post above mine is very funny, ch33rzs :) :) :) :)
ETA 2009, eh? LOL!
Jun 11 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1421
by: abbylee26 | last post by:
<form name="RFO" id="RFO" method="post" action="neworder.asp"> //arow is a hidden field I have made a text field for testing <input name="arow" id="nrow" type="text"> <script language="JavaScript"> if (document.RFO.arow.value) document.write("<div id='AccAmt' style='visibility:hidden'>Amount</div></td>"); else document.write("<div...
2
1598
by: DBLWizard | last post by:
Howdy All, I am trying to detect if the user has cookies enabled on a page and display text accordingly. My cookie detection works but I can't get the divs to work. Here is the javascript and html does anybody have any sugestions? <script language="JavaScript"> function window_onload() { var sCookie;
3
2734
by: boien | last post by:
I have a div container that i have created now i just want to make sure that its horizontally centered in any browser and in any resolution, so that when ever its on 800x600 or 1280x1024 its STILL centered horizontally no matter what, instead of sticking to the left side of the browser window in different res' or window adjusting of any kind....
11
2505
by: Benny123 | last post by:
Im very new to the who css lark so am struggling quite a bit. ive managed to build a basic div centred box with css embedded in my html. It looks fine in IE but loses all size in firefox. Any sugestions guys. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html...
1
1154
by: Randell_D | last post by:
Folks, My script below near-works on both Firefox2 and IE7 (though my end user base will be Firefox2 intranet users only)... "near-works" means it does permit me to place my div tag on the screen but not where I expect. returnLocation() appears to work - it gives me different numeric results depending on the location of my id tag'd url. ...
2
3190
by: vijayakumarkb | last post by:
hii everyone i had an empty div to make a division between two divs. i give a height to the div using css like height: 20px; in IE 7 it is showing the height but in mozilla and safari the height is not showing. the structure is like this <div>
11
4644
by: neovantage | last post by:
Hey all, I have recently started work on div based websites as suggested the great man acoder of this community advise me to learn divs. I made a page using div. In my page i want that content remain at the middle of the page no matter the dimensions of the page are. I mean if the page resolution is 1024 * 768 or 1154 * 864 or 1280 * 768 or...
0
2171
by: nick259 | last post by:
I am working on a HTML page with a flash animation as my banner and Navigation. My problem is that the flash div hangs over my page and I can't see the top where I need to amend text and headings.I have tried moving the div to one side which works but when I return it to the correct position it is out of sync with the page. Is there a way to hide...
1
1781
by: zaxonus | last post by:
Hello, I have had the following problem with Ajax for a few days, and have not been able to solve it even after a few suggestions : - The two files I mention here are copied at the end of this mail, so anyone can look if necessary. I have a main document called : main.php and a sub-document called : SubOne.php My intention is to :
0
7225
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7454
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7184
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7582
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5759
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5145
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4799
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1667
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.