Any idea why this code doesn’t work in IE?
<script type="text/javascript">
$(document).ready(function() {
switchers = $('#switchers > li');
states = $('#state_info > div');
switchers.each(function(idx) {
$(this).data('state', states.eq(idx));
}).click(
function() {
switchers.removeClass('active');
states.removeClass('active');
$(this).addClass('active');
$(this).data('state').addClass('active');
});
});
</script>
I have an unordered list with an id of “switchers”. The li’s act as anchors to toggle the content within a separate “state_info” div (swaps divs of content with the “state_info” div..the visible content div has a class of “active”). I’m not sure if it matters but it’s worth noting that the “switchers” ul is nested in a div, with an id of “map”, which is at the same level of hierarchy as the “state_info” div, so “switchers” and “state_laws” are not at the same parental level...if you understand what I’m trying to say :)
To better explain (in case there is a better solution), the page is meant to display state laws per state via a map. The li’s of “switchers” are positioned absolutely over the states of the map. When the user clicks the state, the individual state’s laws appear in a box below the map. here is the full page of code: https://gist.github.com/3019523 (don't critiquing the mark-up, unless there is something detrimental to the functionality...I know that there is some scripting I could do to eliminate redundant code)
I’m not sure what about the code above doesn’t work with IE. Please help. Thanks in advance!-Steph M--
Our Web site: http://www.RefreshAustin.org/
You received this message because you are subscribed to the Google Groups "Refresh Austin" group.
[ Posting ]
To post to this group, send email to Refresh...@googlegroups.com
Job-related postings should follow http://tr.im/refreshaustinjobspolicy
We do not accept job posts from recruiters.
[ Unsubscribe ]
To unsubscribe from this group, send email to Refresh-Austi...@googlegroups.com
[ More Info ]
For more options, visit this group at http://groups.google.com/group/Refresh-Austin

--
Our Web site: http://www.RefreshAustin.org/
You received this message because you are subscribed to the Google Groups "Refresh Austin" group.
[ Posting ]
To post to this group, send email to Refresh...@googlegroups.com
Job-related postings should follow http://tr.im/refreshaustinjobspolicy
We do not accept job posts from recruiters.
[ Unsubscribe ]
To unsubscribe from this group, send email to Refresh-Austi...@googlegroups.com
[ More Info ]
For more options, visit this group at http://groups.google.com/group/Refresh-Austin

| graphic designer & web developer
t | 512 628 0096 <tel:512%20628%200096>
f | 512 628 0086 <tel:512%20628%200086>
sme...@envision-creative.com <http://sme...@envision-creative.com>
www.envision-creative.com <http://www.envision-creative.com>
facebook | facebook.com/envisioncreative <http://facebook.com/envisioncreative>
twitter | @envisioncreativ
On 6/29/12 1:41 PM, "Jim Bob Howard" <jimbob...@gmail.com <http://jimbob...@gmail.com> > wrote:
Stephanie,
You seem to have a z-index issue going on. Hover over the 'I' in HI and you'll see that you get a pointer cursor. Clicking on that one works.
But your img tags seem to be "above" those and so the LI isn't getting the click.
In the console, I added this and the map worked for me...
$("#map > img").css("cursor","pointer")
.click(
function() {
$("#_" + $(this).attr('id')).click();
});
Blessings,
Jim Bob
On Fri, Jun 29, 2012 at 1:12 PM, Eric Leversen <er...@webchronicconsulting.com <http://er...@webchronicconsulting.com> > wrote:
HI, Steph:
Here's a few links that seem similar to your issue with IE
http://stackoverflow.com/questions/5257866/addclass-and-removeclass-not-working-in-internet-explorer
http://stackoverflow.com/questions/5655563/jquery-addclass-appears-not-to-be-working-in-internet-explorer
http://forum.jquery.com/topic/ie-does-not-re-render-after-addclass
Hope this helps.
Regards,
Eric Leversen
On Jun 29, 2012, at 12:52 PM, Stephanie Meyer wrote: