Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 07-15-2012, 04:45 PM
Contributing Member
Latest Blog:
None

 
Join Date: 08-01-08
Posts: 112
iTrader: 0 / 0%
mouseover popup using js not working only in IE

This code works in opera, safari, firefox and chrome perfectly but not in IE. Anyone know why it doesnt work in IE?

heres the example: http://purpose.im/yanik/test2.php

heres the code:
HTML Code:
<!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> <title>Hello World</title> <script type="text/javascript"> function showBox(text, obj) { helpNode = document.createElement('div'); helpNode.id = 'popBox'; helpNode.setAttribute('class','popBox'); helpNode.innerHTML = text; obj.appendChild(helpNode); } function hideBox() { node = document.getElementById('popBox'); node.parentNode.removeChild(node); } </script> <style type="text/css"> .popBox { position: absolute; z-index: 2; background: #cccccc; width: 600px; padding: 0.3em; border: 1px solid gray; } span { color: red; font-weight: bold; } </style> </head> <body> <div onmouseover="showBox('<b>Foo</b><br /> Baaaaaaaaaaaaaaaaaaaar', this)" onmouseout="hideBox()"><span>hallo</span></div> <div onmouseover="showBox('<b>Bar</b><br /> Baaaaaaaaaaaaaaaaaaaar', this)" onmouseout="hideBox()"><span>hallo</span></div> <div onmouseover="showBox('<b>Biz</b><br /> Baaaaaaaaaaaaaaaaaaaar', this)" onmouseout="hideBox()"><span>hallo</span></div> <div onmouseover="showBox('<b>Biiz</b><br /> Baaaaaaaaaaaaaaaaaaaar', this)" onmouseout="hideBox()"><span>hallo</span></div> </body> </html>
 
Reply With Quote
  #2 (permalink)  
Old 07-15-2012, 11:14 PM
JohnnyS's Avatar
Contributing Member
 
Join Date: 07-05-11
Location: philippines
Posts: 312
iTrader: 0 / 0%
i think setting class via setAttribute is not recognized by IE..

Code:
helpNode.setAttribute('class','popBox');
try to use this one..
Code:
helpNode.className = 'popBox';
 
Reply With Quote
  #3 (permalink)  
Old 07-16-2012, 09:08 PM
webcosmo's Avatar
Contributing Member
 
Join Date: 03-17-07
Location: Boston, MA
Posts: 1,988
iTrader: 5 / 100%
you can use jquery for those browser dependent javascript codes.
 
Reply With Quote
  #4 (permalink)  
Old 07-17-2012, 08:29 AM
mimo91's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 07-11-10
Posts: 216
iTrader: 0 / 0%
Quote:
Originally Posted by webcosmo View Post
you can use jquery for those browser dependent javascript codes.
Jquery is the best for the popup and are cross browsers i prefer using them to avoid browser errors
__________________
Best place for car tips,news and features:car Googler

Best place for games:Legacy TCG
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Popup windows not working, for some viewers... pacific Web Design Lobby 0 04-27-2007 02:15 PM
Mouseover Vdotcom Coding Forum 2 09-20-2006 12:02 PM
mouseover background image re-downloading each mouseover gnznroses Coding Forum 9 08-22-2006 02:04 PM
Simple javascript popup window not working in FF spyderscripts Coding Forum 2 07-15-2006 07:02 PM
Mouseover Images and Bandwidth Jason Coding Forum 4 02-23-2005 04:30 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 06:16 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.