Results 1 to 8 of 8

Thread: Step Carousel Viewer v1.9 not stopping on mouse click

  1. #1
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Step Carousel Viewer v1.9 not stopping on mouse click

    1) Script Title: Step Carousel Viewer v1.9

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...epcarousel.htm

    3) Describe problem:
    I'm using this script on a website. When I use it with <img> or <a> tags, it works most wonderfully. However, I embed YouTube videos in it, using <iframe> tags. The video plays fine, however the issue is that the video gets "carouseled" off after the pause timer elapse is done (i.e. I have mine set to 3 seconds, so you only see three seconds of video before you're autostep'd to the next panel). I tried putting a custom onpanelclick to no avail.
    When there is just an <img> or <a> tag in there, the carousel DOES stop like it should on mouseover and on a mouse click.

    Hopefully someone can help me out .

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm this one is a little tricky, as YouTube videos are embedded via IRAME tags that in turn houses a Flash object. Flash objects by default do not make available events occurring inside them to JavaScript. One somewhat passable solution is to stop the video when the mouse rolls over the player (instead of onclick), by overlaying the carousel with a transparent DIV that reacts to the mouseover event. To do this, inside stepcarousel.js, add the code in red to the init() function:

    Code:
    	init:function($, config){
    		config.gallerywidth=config.$gallery.width()
    		var transdiv = $('<div style="position:absolute; width:100%; height:100%; top:0; left:0; background:white; opacity:0; z-index:1000" />').appendTo(config.$gallery)
    		transdiv.bind('mouseover', function(){
    			config.autostep.status="stopped"
    			stepcarousel.stopautostep(config)
    		})
    This should work in stopping the carousel from stepping as soon as the user mouses over the carousel.

    The other, "real" solution is to embed the youtube video dynamically using JavaScript, then taking advantage of the available functions of Google's Youtube API: https://developers.google.com/youtub..._api_reference That route obviously is a lot more involved.
    DD Admin

  3. #3
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    Hmm this one is a little tricky, as YouTube videos are embedded via IRAME tags that in turn houses a Flash object. Flash objects by default do not make available events occurring inside them to JavaScript. One somewhat passable solution is to stop the video when the mouse rolls over the player (instead of onclick), by overlaying the carousel with a transparent DIV that reacts to the mouseover event. To do this, inside stepcarousel.js, add the code in red to the init() function:

    Code:
    	init:function($, config){
    		config.gallerywidth=config.$gallery.width()
    		var transdiv = $('<div style="position:absolute; width:100%; height:100%; top:0; left:0; background:white; opacity:0; z-index:1000" />').appendTo(config.$gallery)
    		transdiv.bind('mouseover', function(){
    			config.autostep.status="stopped"
    			stepcarousel.stopautostep(config)
    		})
    This should work in stopping the carousel from stepping as soon as the user mouses over the carousel.

    The other, "real" solution is to embed the youtube video dynamically using JavaScript, then taking advantage of the available functions of Google's Youtube API: https://developers.google.com/youtub..._api_reference That route obviously is a lot more involved.
    Oh! Now we're awesomely close to perfection. The only other thing I would "want", and I'm not sure how difficult this would be is to have it also process the mouseOut and resume sliding?
    Code:
    	init:function($, config){
    		config.gallerywidth=config.$gallery.width()
    		var transdiv = $('<div style="position:absolute; width:100%; height:100%; top:0; left:0; background:white; opacity:0; z-index:1000" />').appendTo(config.$gallery)
    		transdiv.bind('mouseover', function(){
    			config.autostep.status="stopped"
    			stepcarousel.stopautostep(config)
    		})
                    transdiv.bind('mouseoout', function(){
    			config.autostep.status="stopped"
    			stepcarousel.stopautostep(config)
    		})
    Maybe? Just a stab in the dark here. I should go through and read all of the code for this script, but I'm on such an insane time crunch for this page .
    Thank you so much for your help thus far!!

  4. #4
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Edit: Nevermind, that's dumb. That just un-does what you fixed for me. The only thing I don't like about that is that it stops the carousel even on img's, say a user accidentally crosses their mouse over that DIV. I think that'll be OK though. I enabled pagination so that if they do that, hopefully the little dots will be enough to let them know there's more content. Thank you for your help again

  5. #5
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm not sure what the rule is on follow up (but unrelated) questions. I would like to add captions to the images and/or IFRAMEs. Is this easily done?

  6. #6
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    You should probably make a new thread for the question, as you are likely to get more attention from it than bumping this thread.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    This thread is less than a week old, so if you have more questions on the same topic you're welcome to ask them here. It's unclear to me exactly how connected the new question will be. If it's completely separate from the old question, you can start a new thread. But if you might need to refer back to the answers/posts here, it's fine to just continue in this thread. It's a borderline case. I hope that clarifies the situation.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    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

    You could use the onslide event to populate a div with a caption. This is explained in some detail on one of the supplemental pages for this script:

    http://www.dynamicdrive.com/dynamici...uppliment3.htm

    Scroll down to the section titled:

    onslide() event
    - John
    ________________________

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

Similar Threads

  1. Step Carousel Viewer v1.9 Page Jumping on click
    By Coldmoonrising in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 07-06-2012, 05:14 PM
  2. Step Carousel working with mouse over ?
    By borislav123 in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-28-2012, 01:35 PM
  3. Step Carousel Mouse Cursor On Opaque Buttons
    By Hoggster in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 10-13-2011, 03:38 PM
  4. loading Step Carousel Viewer in middle of carousel
    By sam4682 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 12-31-2008, 11:07 PM
  5. Step Carousel Viewer v1.6.1 Help Please
    By hax0r in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 11-17-2008, 08:20 PM

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
  •