Results 1 to 6 of 6

Thread: Blending Image Slideshow script error in Opera

  1. #1
    Join Date
    Sep 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Blending Image Slideshow script error in Opera

    Hello,
    I am new to this forum. First of all, thank Dynamic Drive for those great scripts that have saved us great deal amount of time!!!

    I am helping to build an online store but not yet an Javascript expert. We are leveraging the Blending Image Slideshow script, along with others. The script is said to work in Opera 7 (without the blend-in effect of course). But we run into some error in Opera 8.02 complaining about the type. The script works fine with IE6 and Firefox and Netscape as expected. The following is cut & pasted from the Opera 8.02 Javascript console:
    Inline script thread
    Error:
    name: TypeError
    message: Statement on line 5: Could not convert undefined or null to object
    Backtrace:
    Line 5 of inline#8 script in URL removed as requested
    var blenddelay = ie ? document.images.slide.filters[0].duration * 1000 : 0;

    Does anyone knows why or if this is a bug? Thanks in advance.

    Jason
    Last edited by ddadmin; 12-07-2005 at 01:29 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The problem is that opera reads document.all as true but, doesn't do filter styles. Try changing this line on the page:

    var ie=document.all

    to

    var ie=document.all&&!window.opera
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, John. I've tried what you suggested. Same error.

    Any further suggestions? or anyone else has any? Thanks.

    Jason

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That should have fixed it, that's the difference between just looking at the code and experimenting to see what happens. As it turns out, there is another script linked to the page that redeclares the ie variable as only document.all. Best then to deal with it on just the lines affected:
    Code:
    	    <script language="JavaScript1.1">
    		<!--
    		var whichlink=0
    		var whichimage=0
    		var blenddelay=(ie&&!window.opera)? document.images.slide.filters[0].duration*1000 : 0
    		function slideit(){
    		if (!document.images) return
    		if (ie&&!window.opera) document.images.slide.filters[0].apply()
    		document.images.slide.src=imageholder[whichimage].src
    		if (ie&&!window.opera) document.images.slide.filters[0].play()
    		whichlink=whichimage
    		whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    		setTimeout("slideit()",slidespeed+blenddelay)
    		}
    		slideit()
    		//-->
    		</script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thank you. It worked! Yes, in my particular situation, the value of ie vairable was overwritten by declarations in other places. Otherwise, as you pointed out, changing from "var ie=document.all" (as shown in the original script) to "var ie=document.all&&!window.opera" shoulad have fixed the problem on Opera.

    Will this change be made to the original script on http://dynamicdrive.com/dynamicindex14/image4.htm, too? This appears to be a bug on Opera?

    Thanks again,
    Jason

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That should be done but, I'm not affiliated with Dynamic Drive so, a bug report needs to be made. I think I will.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •