Solved

Javascript function not working on Internet Explorer (only), possibly older versions?

Posted on 2013-06-10
12
301 Views
Last Modified: 2013-06-10
On this page:
http://www.lieverhymanpotter.com/videos.php

If you click the LEFT and RIGHT arrow buttons, it should scroll through thumbnails of the six videos (Jim Potter on the far left, Mike McGuckin on the far right).

This works fine on every (up-to-date) browser I have, both Macintosh and Windows.

My client is insisting the RIGHT arrow does not work on their computers (but the LEFT does). They have tried multiple computes, I believe they are all running Internet Explorer, but I don't know what version.

Here is the jQuery/Javascript for the RIGHT arrow:

$('#videoArrowRight').click(function(){
	console.log($('#videoSlideShow').position().left);
	if ($('#videoSlideShow').position().left<=-552){
		$('#videoSlideShow').animate({left:'-=20px'}, 200);
		$('#videoSlideShow').animate({left:'+=20px'}, 200);
	} else {
		$('#videoSlideShow').animate({left:'-=184px'});
	}
});

Open in new window


I can't understand where the problem would be, or why only their computers would have the problem. I can't run any kind of developer tools on their computer to see what is going on, either.

Any advice? Thank you!
0
Comment
Question by:bbdesign
  • 4
  • 4
  • 3
  • +1
12 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39235623
Would be better with a live link, a few lines of js tell us nothing.
0
 

Author Comment

by:bbdesign
ID: 39235631
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39235640
In IE8 on Windows XP SP3, the right arrow does not work.
0
 
LVL 4

Expert Comment

by:BAKADY
ID: 39235646
i had problems with a client because IE7/8 and jquery too.
IE8 make really stress in your CSS layout, try z-Index to get your Left/Right Arrows in foreground. Animate don't works fine either, i had something like this $('myObject').animate({opacity:0}); and visibility, i was crazy around a week because this...
i made 2 WM with IE 7 and IE 8, i tried the page with each update that i found... and everything was working, but the client said: "all errors are here, nothing is changed"
finaly i had to go to the client, i cleared the IE cache and reload the page... then was everything fine...

good luck
0
 

Author Comment

by:bbdesign
ID: 39235664
DaveBaldwin... as you can see in my script, I have a console.log displaying the position of the slide element whenever the right arrow is clicked. Are you able to launch a Javascript console in IE8 on Windows XP SP3 and let me know if that is displaying? That would at least tell me whether or not the function is firing.

Thanks!
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39235674
Console log will not work in IE8 (unless you have developer tools open) - this may be breaking the code.
Now I'm guessing they are using IE8....
Need to know the version else we're chasing our tails
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39235689
That was interesting.  When I pressed F12 to bring up the Developer Tools, it started working.  After I closed IE8 and restarted/reloaded the page, it didn't work again.  I'm wondering if the 'console.log' line is actually the problem.  Make second page without it like 'videos2.php' and let us try that.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39235691
Beat you to it Dave...
0
 

Author Comment

by:bbdesign
ID: 39235708
I took the console.log out, can you verify if that fixed it? There was no console.log on the LEFT arrow, which might explain this. I can't believe this whole issue was caused by that (actually, I could)... I thought console.log was pretty benign. I guess not.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39235719
Working fine now
You could check if the console is present with
if (window.console && 'function' === typeof window.console.log) {
  //do logging
}
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39235748
Yep, appears to work fine now... even if Gary got there first.
0
 

Author Closing Comment

by:bbdesign
ID: 39235833
Thanks guys!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now