Results 1 to 4 of 4

Thread: script Open offsite links in new window not working with pop rollovers

  1. #1
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question script Open offsite links in new window not working with pop rollovers

    1) Script Title: Open offsite links in new window

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

    3) Describe problem:
    The script works excelent for links that are on text.
    **Example**
    Code:
        <div class="Artistic-Body-P">
            <span class="Artistic-Body-C">
                <a href="http://externallink.com" style="text-decoration:none;">test</a>
            </span>
        </div>
    but it's not working for links that are within div rollover.
    **Example**
    Code:
        <div id="div_popup_roll_13" style="position:absolute;left:109px;top:259px;width:76px;height:76px;">
            <a href="http://externallink.com" rev="image1.png~#~-14~#~-15~#~text~#~148~#~-119~#~#949393~#~Tahoma~#~30~#~0~#~1~#~transparent~#~165">
                <img src="image2.png" border="0" width="76" height="76" id="popup_roll_13" alt="">
            </a>
        </div>
    I have been busting my head for many days how to fix this, but guess that the fact that I'm beginner, doesn't help so I decided to post here.




    here is the code from poproll:
    Code:
    (function($){jQuery.fn.poproll=function(settings){var m_bHovering=false;var m_nDivId=0;
        var $m_ImageDiv=null;var $m_TextDiv=null;
        var eOptions={Img:0,ImgPosX:1,ImgPosY:2,Txt:3,TxtPosX:4,TxtPosY:5,TxtCol:6,TxtFont:7,TxtSize:8,TxtItallic:9,TxtBold:10,TxtBkgrndCol:11,TxtWidth:12};
        function ClosePopup(){if($m_ImageDiv!==null){$m_ImageDiv.remove();
        $m_ImageDiv=null;if($m_TextDiv!==null){$m_TextDiv.remove();
        $m_TextDiv=null}}}function HoverOver(div){m_bHovering=true;var nDivId=$(div).attr('id');
        if(nDivId!==m_nDivId){m_nDivId=nDivId;ClosePopup()}if($m_ImageDiv===null){var anchor=$(div).find('a');
        var optionArray=$(anchor).attr('rev').split('~#~');
        var href=$(anchor).attr('href');
        if(href===undefined){$(div).append('<div id="poproll_img" style="position:absolute; left:'+optionArray[eOptions.ImgPosX]+'px; top:'+optionArray[eOptions.ImgPosY]+'px; z-index:100;"><img src="'+optionArray[eOptions.Img]+'" name="popup_roll_2" alt="" style="position:absolute;left:0px;top:0px;"></div>')}else{$(div).append('<div id="poproll_img" style="position:absolute; left:'+optionArray[eOptions.ImgPosX]+'px; top:'+optionArray[eOptions.ImgPosY]+'px; z-index:100;"><a href='+href+'><img src="'+optionArray[eOptions.Img]+'" name="popup_roll_2" alt="" border="0" style="position:absolute;left:0px;top:0px;"></a></div>')}$m_ImageDiv=$('#poproll_img');
        if(optionArray[eOptions.Txt].length>0){var fontStyle=optionArray[eOptions.TxtItallic]>0?'italic':'normal';
        var fontWeight=optionArray[eOptions.TxtBold]>0?'bold':'normal';$(div).append('<div id="poproll_txt" style="position:absolute; left:'+optionArray[eOptions.TxtPosX]+'px; top:'+optionArray[eOptions.TxtPosY]+'px; width:'+optionArray[eOptions.TxtWidth]+'px; color:'+optionArray[eOptions.TxtCol]+'; font-size:'+optionArray[eOptions.TxtSize]+'; font-family:'+optionArray[eOptions.TxtFont]+'; font-style: '+fontStyle+'; font-weight:'+fontWeight+'; background-color:'+optionArray[eOptions.TxtBkgrndCol]+'; z-index:100;">'+optionArray[eOptions.Txt]+'</div>');$m_TextDiv=$('#poproll_txt')}}}function HoverOut(){m_bHovering=false;window.setTimeout(function(){if(!m_bHovering){ClosePopup()}},100)}this.hover(function(){HoverOver(this)},function(){HoverOut()})}})(jQuery);

    All help and suggestion is appreciated in advance.
    THNX

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,336
    Thanks
    30
    Thanked 137 Times in 132 Posts
    Blog Entries
    32

    Default

    This, maybe?
    Code:
    <div id="div_popup_roll_13" style="position:absolute;left:109px;top:259px;width:76px;height:76px;">
    <a href="http://externallink.com" rev="image1.png~#~-14~#~-15~#~text~#~148~#~-119~#~#949393~#~Tahoma~#~30~#~0~#~1~#~transparent~#~165">
    <img onclick="window.location.href='http://externallink.com'" src="image2.png" border="0" width="76" height="76" id="popup_roll_13" alt="">
    </a>
    </div>

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

    surfer (03-28-2013)

  4. #3
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much for prompt reply, just tried the solution you suggested, unfortunately it's not working.
    Do you have some other suggestions that I can try?

  5. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,336
    Thanks
    30
    Thanked 137 Times in 132 Posts
    Blog Entries
    32

    Default

    Well, the DD script is not the problem since the following works (I'm using your own solution together with a small modification):
    Code:
    <script type="text/javascript" src="ddwindowlinks.js">
    /***********************************************
    * Open offsite links in new window- (c) Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    </script>
    
    <div id="div_popup_roll_13" style="position:absolute;left:109px;top:259px;width:76px;height:76px;">
    <a href="http://externallink.com" >
    <img src="http://img.youtube.com/vi/AVgbEkBWuqs/0.jpg" border="0" width="76" height="76" id="popup_roll_13" alt="" onmouseover="this.src='http://img.youtube.com/vi/AVgbEkBWuqs/3.jpg'" onmouseout="this.src='http://img.youtube.com/vi/AVgbEkBWuqs/0.jpg'">
    </a>
    </div>

  6. The Following User Says Thank You to molendijk For This Useful Post:

    surfer (03-29-2013)

Similar Threads

  1. Open offsite links in new window - HELP
    By EmbersCC in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 06-07-2009, 10:06 AM
  2. Open offsite links in new window
    By EmbersCC in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-04-2009, 08:35 PM
  3. Open Offsite Links in New Window
    By baz999 in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 12-14-2007, 05:48 PM
  4. Interaction btw Open offsite links in new window & Tab content script
    By Wildfire563 in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 09-06-2006, 12:59 AM
  5. Open offsite links in new window
    By WwTIPPYwW in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 02-05-2005, 03:00 AM

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
  •