Results 1 to 3 of 3

Thread: 'Session' or not 'session'

  1. #1
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default 'Session' or not 'session'

    1) Script Title: Stay on Top content script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici.../stayontop.htm

    3) Describe problem:

    First, the content is inside an external file and dynamically added to the page using Ajax.

    In short: When the setting "frequency" is "session": Stay on Top pop-up window appears once per browser session. OK, This is what I need.

    After closing the window (manually or by a countdown), there is the possibility to be re-opened by a text link, that is, a new variable. All is correct. I open and close the Stay on Top window at will... but only if I don't browse beyond this page. If I return, there is (obviously) not the automatic pop-up window BUT clicking on text link also has no effect at all.

    Is there a workaround to set an effective frequency "always" to the text link variable?

    Thanks in advance for your unvaluable help!

    Luys
    Last edited by Luys; 06-02-2012 at 08:51 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,924
    Thanks
    43
    Thanked 3,187 Times in 3,151 Posts
    Blog Entries
    12

    Default

    Not exactly. The problem is that once the cookie is set, the AJAX content isn't imported, so there's no way to show it. What we can do is import it if it's not there, then we can show it.

    Put this script in the head of your page after the scripts for Stay on Top content:

    Code:
    <script type="text/javascript">
    alwaysOnTop.showAgain = function(targetid){
    	var s = alwaysOnTop.settingscache[targetid], $t;
    	if(!($t = jQuery('#' + targetid)).size()){
    		alwaysOnTop.loadajaxcontent(jQuery, s);
    	} else {
    		alwaysOnTop.positiontarget($t, s);
    	}
    	alwaysOnTop.revealdiv(jQuery('#' + targetid), s);
    };
    </script>
    Now you can have a link like so:

    Code:
    <a href="#" onclick="alwaysOnTop.showAgain('ajaxdiv'); return false;">Show BC</a>
    where ajaxdiv is the targetid that was used to init the content.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Luys (06-02-2012)

  4. #3
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default

    Only a few words, and the result is as if I had suddenly new graduated glasses: now I see everything much clearer. Very grateful for your help. Now I have a full solution without fringes.

    Thank you, Dr. John, for your prescription lenses! ;-)

    Luys

Bookmarks

Posting Permissions

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