Results 1 to 5 of 5

Thread: Ultimate Fade-in slideshow (v2.4) popup link?

  1. #1
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow (v2.4) popup link?

    1) Script Title: Ultimate Fade-in slideshow (v2.4)

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

    3) Describe problem: Not really a problem, it is a great script. I would like to know if it is possible to have the link be a popup window. With the existing script I can have a line

    ["portfolio/boys/01V-004-small.jpg", "splash_popup.php?param1=portfolio/boys/01V-004.jpg", "_new", "01 vertical"]

    that will open a new window. But I would like a popup window so the user can see a larger version image without leaving the page.

    Thanks

  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

    Put this script in the head of the page:

    Code:
    <script type="text/javascript">
    jQuery('.gallerylayer a').live('click', function(e){
    	if(this.target === '_new'){
    		open(this.href, this.target, 'width=500, height=450, top=100, left=175, resizable, scrollbars');
    		e.preventDefault();
    	}
    });
    </script>
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    MikeHale (01-20-2012)

  4. #3
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks John,

    I understand what that script does but I don't think I would have been able to created it myself. I modified some of the open arguments and it does exactly what I needed.

  5. #4
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    262
    Thanks
    42
    Thanked 24 Times in 24 Posts

    Default lost focus()

    I just tried this. It worked on first click, but POP did not regain focus on second click (so it remained hidden behind larger window). How would focus() be resolved?

    Recently had the same problem (losing focus) with old myopen.js. The mypop.js regains focus for POP. As used in http://www.auntnini.com/sites . http://www.jacquimorgan.com, http://www.josephdenaro.com, http://www.chanit.com.

    Code:
    /*myopen*/
    // JavaScript Document
    // separate window for link    
    
    // CG215 separate window for link    
            function myopen(url)
        {    window.open (url, 'links', 'toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=auto,resizable=yes,dependent=yes,width=400,height=400'); window.blur();
    	    }
    		var links; //to avoid "undefined" message
    //  JavaScript Unleashed's onUnload event handler
            function clean() { 
              if (links != null) { links.close() }; 
            } 
    ==============
    /*mypop*/
    /*in BODY <a href="#nogo" onclick="loadpage('../things/___.jpg')">TEXT</a>*/
              
    // JavaScript Document
    var mypop=null;
    function loadpage(url) {
    	if ((!mypop) || (mypop.close)) {
    		mypop = window.open (url, 'mypop', 'width=400px,height=375px,toolbar=0,resizable=1,screenx=0,left=20,screeny=0,top=20');
    		} else { mypop.document.location.href=url; }
    		mypop.focus(); return true; 
    	}
    Also I read something about new/open window "features" not being supported in HTML5/CSS3?
    Last edited by auntnini; 01-20-2012 at 10:28 PM. Reason: fix example link

  6. #5
    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

    Since you asked . . .

    If you want to assert focus with each popup that's created, it's probably best to use _blank (which requires a new window even if one has already been spawned) instead of _new (which will reuse a previously spawned window if its target was also _new) as the target. However, that has the potential of creating tons of child windows. So folks like to use _new. As long as the previously spawned window has been closed, any _new window will gain focus. You can even try various methods in an effort to close the previously spawned window before opening a new _new one, or to give the reused window focus.

    I still like the simplicity of either using _blank and running the risk of tons of _blank windows being opened, or - my preferred option, using _new and letting the user deal with it. They may have to occasionally hunt for the window which now has their selected content but which has perhaps lost focus.

    As for:

    Also I read something about new/open window "features" not being supported in HTML5/CSS3?
    Show me the demo where this is an issue.

    That said, and though it's more complicated, for something like this I would favor opening a DHTML modal window like FancyBox to opening an actual new instance of the browser.

    But that wasn't the original question.
    - John
    ________________________

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

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    auntnini (01-21-2012)

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
  •