Jump to content

Recommended Posts

I tried to create a colour picker component for forms, using JavaScript.

 

You can see the example here:http://www.myointernational.com/shine/testy.php (being javascript, just view source for the code... if you want to use it, go ahead.

 

For some reason I can't get it to work in firefox. It works fine in Chrome and IE6+ but Firefox 3.5.7 is just not showing the "popup" div.

 

Can anyone suggest what might be causing the issue and try to replicate it... I'm not sure if it's just  this machine...

 

Suggestions please?

Link to comment
https://forums.phpfreaks.com/topic/188948-firefox-not-working-like-ie-or-chrome/
Share on other sites

Browsers use different event models.  This is why cross-browser errors tend to crop up.  In order to ensure your code works well in all browsers, you'll need to equalize the event models:

 

function functionName(evt) {
   evt = (evt) || window.event;

   // function processing here
}

 

This is one of the reasons why people use frameworks - they equalize the event models out of the box.

 

Also, just for your own sanity, and for those of us who you ask to look through your code, you should really move your CSS to an external file.  It's very difficult reading your code with a bunch of inline stylesheets in every element.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.