English 中文(简体)
jQuery colorbox only binds to 1 element in IE 7 and FF 3.0
原标题:

I m just about finished writing a backend for a website in PHP/MySQL/jQuery, but my jQuery colorboxes aren t working in older versions of IE and Firefox.

Steps to reproduce problem: 1. Navigate to http://swstrailers.com/ 2. Scroll to the very bottom and click the Login link in the right corner 3. Leave the fields blank and click the Login button

At this point, the page will reload will an error telling you that the login has failed. There will be a link to login again in the yellow error box as well as the login link at the bottom of the page.

In IE 7 and FF 3.0, only the login link in the yellow error box will popup the colorbox properly; the login link at the bottom of the page will now just load the login form in a new, empty page.

In FF 3.5+ and newer versions of Chrome and Safari, both links popup the colorbox (as is expected).

Does anyone know why this is happening? It seems like jQuery is failing to bind the .colorbox() event to every link on page load.

The file holding the bindings is swstruckbodiesandtrailers.com/_scripts/common.js

最佳回答

id attribute should be unique in one page, jQuery selector $( a#ajaxLogin ) returns only the first element. If you want more elements to trigger colorbox, use class attribute ie: <a class="ajaxLogin" [...] and in js: $( a.ajaxLogin )

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签