0
Welcome Guest! Login
0 items Join Now

Rokbox Popup on Load?

  • Rokbox Popup on Load?

    Posted 11 years 2 months ago
    • Id really like to be able to use Rokbox to create a popup that appeared when a page loaded.
      Preferably, the pop up would appear only once per session.
      I didn't see a way to do this in the instructions.
      Perhaps I should be looking for a different extension?
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: Rokbox Popup on Load?

    Posted 11 years 2 months ago
    • I am afraid that RokBox can't be used in that way
    • Check my services at: Mihha-Vision
    • Quag's Avatar
    • Quag
    • Jr. Rocketeer
    • Posts: 43
    • Thanks: 0

    Re: Rokbox Popup on Load?

    Posted 10 years 9 months ago
    • I also need functionality like this. I want to offer newsletter subscriptions to 1st time visitors, and they should only see the popup on the 1st page they view. There are other extensions that offer this type of functionality, but I'd much rather use RokBox then add another lightbox library to my whole website.

      Are there any ways to handle this through some custom javascript and advanced module manager?
    • Quag's Avatar
    • Quag
    • Jr. Rocketeer
    • Posts: 43
    • Thanks: 0

    Re: Rokbox Popup on Load?

    Posted 10 years 9 months ago
    • I was thinking about this a little more. I believe all I would need is a little javascript to trigger a RokBox link on page load.
      That JS would go in a custom HTML module, and Advanced Module Manager could set it to only display the module on the first visit of a Joomla Session. Here's the PHP for that, taken from NoNumber's FAQ:
      // the maximum number of pageloads after a new session
      $max = 10;
      
      // DO NOT EDIT BELOW
      $session = JFactory::getSession();
      return ( $session->get( 'session.counter', 0 ) <= $max );

      I've been playing around with some JS, but I'm not savvy with the language yet. I've tried this, but it is redirecting all internal pages to the homepage with a # in the URL:
      <a id="emailClick" class="" data-rokbox="" href="#" data-rokbox-element="#rt-popup">Subscribe</a>
      
      <script type="text/javascript">
          var l = document.getElementById('emailClick');
              for(var i=0; i<1; i++){
                  l.click();
              }
      </script>

Time to create page: 0.070 seconds