www.webdeveloper.com
Results 1 to 4 of 4

Thread: Automatic Trigger

  1. #1
    Join Date
    May 2012
    Posts
    3

    Automatic Trigger

    Hi, I have a link on my website call select location which I can click. once clicked a popup appears from where i can choose a location. ( code below )

    I am looking to do a conditional statement, if it equals true make this popup appear automatically:

    if($example!==1) {
    I need some javascript in here which will show to popup box automatically
    }

    Thanks in advance


    The Code:

    <!--LOCATION POPUP-->
    <div class="pop_wrap">
    <div id="light" class="white_content">
    <div class="p_close"><a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.dis play ='none'">Close</a></div>
    <div class="p_location_select_wrap">
    <div class="p_logo"></div>
    <div class="p_location_select_text"><span class="mid_grey_bold">Please select your location</span></div>
    <?php $this->load->view('_blocks/select_country') ?>
    </div>
    </div>
    <div id="fade" class="black_overlay"></div>
    </div>
    <!--LOCATION POPUP END-->

  2. #2
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    Try this code:
    Code:
    if($example!==1) {
      window.open("page_popup.html", "win2", "width=310,height=600,scrollbars=yes");
    }

  3. #3
    Join Date
    May 2012
    Posts
    3
    Thanks for the help. The problem I have with that method is the physical popup of a window. The code above uses a lightbox effect, once the link change location is clicked:

    <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').styl e.display='block'">Change Location</a>


    a lightbox/popup appears with a lightbox effect which shows on the current page.

    I need a way to visit that link automatically based on a false condition.

    Thanks in advance really appreciate it

  4. #4
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    I think something like this:
    Code:
    if(condition === false){
      document.getElementById('light').style.display='block';
      document.getElementById('fade').style.display='block';
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles