Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
jquery cross browser issue
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stephanie Meyer  
View profile  
 More options Jun 29 2012, 1:52 pm
From: Stephanie Meyer <sme...@envision-creative.com>
Date: Fri, 29 Jun 2012 10:52:23 -0700 (PDT)
Local: Fri, Jun 29 2012 1:52 pm
Subject: jquery cross browser issue

 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephanie Meyer  
View profile  
 More options Jun 29 2012, 1:57 pm
From: Stephanie Meyer <sme...@envision-creative.com>
Date: Fri, 29 Jun 2012 10:57:29 -0700 (PDT)
Local: Fri, Jun 29 2012 1:57 pm
Subject: Re: jquery cross browser issue

also, here is the url to the page:
http://www.lookoutservices.net/lookout-services-i-9-e-verify/state-law/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Fawcett  
View profile  
 More options Jun 29 2012, 1:57 pm
From: John Fawcett <johnfawc...@goodybag.com>
Date: Fri, 29 Jun 2012 12:57:21 -0500
Local: Fri, Jun 29 2012 1:57 pm
Subject: Re: [Refresh Austin: 6542] jquery cross browser issue

Not totally sure, but sometimes IE has some issues with scoping and what-not when you leave off 'var' from your variable declarations.

On Jun 29, 2012, at 12:52 PM, Stephanie Meyer wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Leversen  
View profile  
 More options Jun 29 2012, 2:12 pm
From: Eric Leversen <e...@webchronicconsulting.com>
Date: Fri, 29 Jun 2012 13:12:44 -0500
Local: Fri, Jun 29 2012 2:12 pm
Subject: Re: [Refresh Austin: 6542] jquery cross browser issue

HI, Steph:

Here's a few links that seem similar to your issue with IE
http://stackoverflow.com/questions/5257866/addclass-and-removeclass-n...
http://stackoverflow.com/questions/5655563/jquery-addclass-appears-no...
http://forum.jquery.com/topic/ie-does-not-re-render-after-addclass

Hope this helps.

Regards,

Eric Leversen
e...@webchronicconsulting.com

On Jun 29, 2012, at 12:52 PM, Stephanie Meyer wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Bob Howard  
View profile  
 More options Jun 29 2012, 2:41 pm
From: Jim Bob Howard <jimbobhow...@gmail.com>
Date: Fri, 29 Jun 2012 13:41:15 -0500
Local: Fri, Jun 29 2012 2:41 pm
Subject: Re: [Refresh Austin: 6545] jquery cross browser issue

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 <

--
Jim Bob Howard
-----------------------------------------------------------
SharePoint 2010 at Work: Tips, Tricks, and Bold Opinions
The Best of EndUserSharePoint.com
http://amzn.to/SP2010-at-Work <http://www.sharepointsaturday.org/austin>

Follow me on Twitter: www.twitter.com/jbhoward


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephanie Meyer  
View profile  
 More options Jun 29 2012, 4:11 pm
From: Stephanie Meyer <sme...@envision-creative.com>
Date: Fri, 29 Jun 2012 15:11:31 -0500
Local: Fri, Jun 29 2012 4:11 pm
Subject: Re: [Refresh Austin: 6546] jquery cross browser issue

Hey Jim,

I see where you are going with this and I like it, however when I tried to
apply it to my code it didn’t work. Can you please send the full script with
what you intended? I’m not the jquery master I wish I were, first of all,
and my brain is fried due to stress and lack of sleep.

Thanks so much!

______________________________

Stephanie Meyer | graphic designer & web developer

3400 northland
austin, tx  78731
t | 512 628 0096
f | 512 628 0086

sme...@envision-creative.com
www.envision-creative.com

facebook | facebook.com/envisioncreative
twitter | @envisioncreativ

On 6/29/12 1:41 PM, "Jim Bob Howard" <jimbobhow...@gmail.com> wrote:

  image.jpg
51K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Bob Howard  
View profile   Translate to Translated (View Original)
 More options Jun 29 2012, 4:26 pm
From: Jim Bob Howard <jimbobhow...@gmail.com>
Date: Fri, 29 Jun 2012 15:26:41 -0500
Local: Fri, Jun 29 2012 4:26 pm
Subject: Re: [Refresh Austin: 6547] jquery cross browser issue

Sure.

Just change what you have to this:

$(document).ready(function() {
$("#map > img")
 .css("cursor","pointer")
 .click(function() {
 // Gets the id from the img and uses it to click the appropriate #switcher

> li

   $("#_" + $(this).attr('id')).click();
 });
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');

});
});

Blessings,
Jim Bob

On Fri, Jun 29, 2012 at 3:11 PM, Stephanie Meyer <

--
Jim Bob Howard
-----------------------------------------------------------
SharePoint 2010 at Work: Tips, Tricks, and Bold Opinions
The Best of EndUserSharePoint.com
http://amzn.to/SP2010-at-Work <http://www.sharepointsaturday.org/austin>

Follow me on Twitter: www.twitter.com/jbhoward

  image.jpg
51K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephanie Meyer  
View profile  
 More options Jun 29 2012, 7:03 pm
From: Stephanie Meyer <sme...@envision-creative.com>
Date: Fri, 29 Jun 2012 18:03:46 -0500
Local: Fri, Jun 29 2012 7:03 pm
Subject: Re: [Refresh Austin: 6548] jquery cross browser issue

Jim, you freaking rock! :-) Thank you for your help!

______________________________

Stephanie Meyer | graphic designer & web developer

3400 northland
austin, tx  78731
t | 512 628 0096
f | 512 628 0086

sme...@envision-creative.com
www.envision-creative.com

facebook | facebook.com/envisioncreative
twitter | @envisioncreativ

On 6/29/12 3:26 PM, "Jim Bob Howard" <jimbobhow...@gmail.com> wrote:

  image.jpg
51K Download

  image.jpg
51K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »