Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help with simple popup

    Hey guys, I'm new to the site, and very unfamiliar with JS. I'm pretty familiar with PHP and HTML...but js is just out of my realm.

    I'm trying to create a site where I have a facebook plugin script running. I don't want it to be static to the page, I'd rather have it be a popup box upon entering - Similar to what daylong.com does. The popup only occurs if you come from facebook, and not when you type the addy in manually but I'm not that concerned about that for my site. I simply want the box to float or popup on page load, then have a small X on the top right corner to close it out.

    The code I would I need in the popup box looks like this:

    Code:
    <div class="fb-like-box" data-href="http://www.facebook.com/theshizwefind" data-width="400" data-height="250" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>
    I'm not sure how much coding would be required. If it's too much to ask for someone to do a quick code example, could you at least point me in the direction I need to go to learn it for myself?

    Thanks in advance,

    Keith

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Modern browsers block unrequested pop-ups.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New Coder seanmarkham's Avatar
    Join Date
    Dec 2011
    Location
    Lincolnshire, England
    Posts
    50
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Don't know if this would be any good for you.

    Code:
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>
    
    $(document).delay(1000).queue(function nWin(){
    
      var w = window.open('http://www.facebook.com/theshizwefind','Facebook', 'width = 500, height = 500');
    
    
        $(w.document.body).html(html);
    });
    
    $(function() {
        $("a#print").click(nWin);
    });
    </script>
    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development


  •  

    Posting Permissions

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