treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Load website + Jquery popup

  • Hello,

    For a project im working on i need some help.

    I have a website. This website also sends mailings.
    Now in the email there has to be a link to a registration form.
    If the link is clicked the projectwebsite should load in a browser but it also have to show a popup.

    Something like this:
    http://fortysevenmedia.com/tuts/popupemail/#emailpopup

    notice that i link to an anchor #emailpopup
    The anchor doesnt show the popup.
    If you click Email someone, you can see what i want.

    Basically the href has to show the website with a layer over it.
    So if linked to www.domain.com it shows the normal website,
    when linked to www.domain.com/#regpopup it shows the website + a jquery popup over the website.

    Help plz, been bugging me for a few hours now :S
  • nobody knows the answer? I really need this fixed :S
  • Hello,

    why do you link direct to an anchor? Link directly to the side and build inside an Event to an onload-function like:

    <body onload="openmail()"> and put the function inside your $(document).ready(function(){});. Or call the function as the last one in the document.ready function of JQuery to execute it as the last one on the first load of the page.

    Greetings
  • I know that is possible, but the problem is that if people visit the website normally it must not show.
    thats why i want it in in anchor so i can link directly to it. E.g. link out of an email.
  • You need to use javascript to check if the window has the hash.

    You can get the window's has with this
    var hash = window.location.hash


    Then you need to see if the hash is equal to the popup's id
    if( hash.replace(/#/', '') == 'email_popup' ) {
    $('#email_popup').show();
    };
  • is this method still new? I have some problem creating optin popup, unblockable popup with Jquery popup..
  • hey dude can you please submit the full referenced data