1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pinterest Pin It Code - How to make it a Pop Up Window?

Discussion in 'HTML & JavaScript' started by Scorpion Ghost, Sep 2, 2013.

  1. Scorpion Ghost

    Scorpion Ghost Senior Member

    Joined:
    Mar 22, 2013
    Messages:
    876
    Likes Received:
    171
    Hey everyone. Two days ago i got this code for a pinterest hover pin it code, and i installed it on my blogger blog, and i set an image of my own as the icon, and everything is perfect. However, i have one issue i need help with...

    When the Pin It icon is clicked, it opens in a New Tab, but i would like to make it open in a Pop Up window. Is it possible to do this??

    Here is the code i am using:

    Code:
    <script>
    //<![CDATA[
    var bs_pinButtonURL = "http://2.bp.blogspot.com/-rwtYRUjgDok/UiJ-EfGfrbI/AAAAAAAAAXg/QXRpDUzaa6s/s1600/Pinterest+Red.png";
    var bs_pinButtonPos = "topright";
    var bs_pinPrefix = "";
    var bs_pinSuffix = "";
    //]]>
    </script>
        <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'/>
    <script id='bs_pinOnHover' src='http://greenlava-code.googlecode.com/svn/trunk/publicscripts/bs_pinOnHoverv1_min.js' type='text/javascript'>
    // Visit http://www.bloggersentral.com/2012/11/pinterest-pin-it-button-on-image-hover.html for details.
    </script>


    I did try finding a solution to this, but failed... And keep in mind im a noob for codes and HTML's and Javascripts etc, so if there is a solution please be descriptive...

    Thank you :)
     
  2. CodeNinja

    CodeNinja Newbie

    Joined:
    Sep 25, 2013
    Messages:
    47
    Likes Received:
    26
    Post unobfuscated JavaScript then maybe we can work something out.
    greenlava-code.googlecode.com/svn/trunk/publicscripts/bs_pinOnHoverv1_min.js - this code is minified - unreadable


    The other solution is to develop the Pinterest hover script from scratch
     
    • Thanks Thanks x 1
  3. CodeNinja

    CodeNinja Newbie

    Joined:
    Sep 25, 2013
    Messages:
    47
    Likes Received:
    26
    Actually after noticing that It has been 3 months since you asked and no one solved the problem. I decided to give it a closer look. Enjoy:

    Code:
    
    $(function() {
        $('body').on('click', '.pinit-wrapper', function() {
            event.preventDefault();
            window.open($('.pinit-wrapper a[href]').attr('href'), "_blank", ' width=500, height=500')
        })
    })
    
    
    
    
    This works with jQuery 1.7+
     
    • Thanks Thanks x 1
  4. Scorpion Ghost

    Scorpion Ghost Senior Member

    Joined:
    Mar 22, 2013
    Messages:
    876
    Likes Received:
    171
    :You_Rock_ :30: :target:


    It Wooorks!!! :AR15firin

    This was one of the very few things i gave up on, for the time being. First i tried to do it myself, that didn't work. Then I asked on 5-6 forums, and nobody knew anything. Even on Stack Overflow I got nothing...

    Brother, what can i do for you? :D Big Big Big Thanks...


    For any other noobs like me, the code that CodeNinja gave needs to be inserted between
    AND
    haha i started from the bottom going up, wasn't sure where to put the code you gave.

    Well, thread closed, SOLVED!

    p.s If i could i'd click the Thanks button 50 times right now :clap2:
     
    Last edited: Dec 15, 2013