Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [inne]Ciasteczka wyswietlanie ifreme o okreslonym czasie
Forum PHP.pl > Forum > Przedszkole
bambolo
Witam posiadam mały skrypt na stronie ktory wywala mi przy wejsciu na www małą ramke ,problem w tym ze nie chce aby ona startowała za kazdym razem gdy user wejdzie na strone wiec pytanie mam jak zastosowac ciasteczka dla tego kawałka ktory przedstawiam ponirzej tak aby okienko wyskakiwało raz na 6-12 lub 24h. Moze mi to kto dopisac / byłbym wdzieczny smile.gif

oto kawałek kodu odpowiadający za wyswietlanie ramki

  1. if (typeof dhtmlwindow=="undefined")
  2.  
  3. alert('ERROR: Modal Window script requires all files from "DHTML Window widget" in order to work!')
  4.  
  5.  
  6.  
  7. var dhtmlmodal={
  8.  
  9. veilstack: 0,
  10.  
  11. open:function(t, contenttype, contentsource, title, attr, recalonload){
  12.  
  13. var d=dhtmlwindow //reference dhtmlwindow object
  14.  
  15. this.interVeil=document.getElementById("interVeil") //Reference "veil" div
  16.  
  17. this.veilstack++ //var to keep track of how many modal windows are open right now
  18.  
  19. this.loadveil()
  20.  
  21. if (recalonload=="recal" && d.scroll_top==0)
  22.  
  23. d.addEvent(window, function(){dhtmlmodal.adjustveil()}, "load")
  24.  
  25. var t=d.open(t, contenttype, contentsource, title, attr, recalonload)
  26.  
  27. t.controls.firstChild.style.display="none" //Disable "minimize" button
  28.  
  29. t.controls.onclick=function(){dhtmlmodal.close(this._parent, true)} //OVERWRITE default control action with new one
  30.  
  31. t.show=function(){dhtmlmodal.show(this)} //OVERWRITE default t.show() method with new one
  32.  
  33. t.hide=function(){dhtmlmodal.close(this)} //OVERWRITE default t.hide() method with new one
  34.  
  35. return t
  36.  
  37. },
  38.  
  39.  
  40.  
  41.  
  42.  
  43. loadveil:function(){
  44.  
  45. var d=dhtmlwindow
  46.  
  47. d.getviewpoint()
  48.  
  49. this.docheightcomplete=(d.standardbody.offsetHeight>d.standardbody.scrollHeight)? d.standardbody.offsetHeight : d.standardbody.scrollHeight
  50.  
  51. this.interVeil.style.width=d.docwidth+"px" //set up veil over page
  52.  
  53. this.interVeil.style.height=this.docheightcomplete+"px" //set up veil over page
  54.  
  55. this.interVeil.style.left=0 //Position veil over page
  56.  
  57. this.interVeil.style.top=0 //Position veil over page
  58.  
  59. this.interVeil.style.visibility="visible" //Show veil over page
  60.  
  61. this.interVeil.style.display="block" //Show veil over page
  62.  
  63. },
  64.  
  65.  
  66.  
  67. adjustveil:function(){ //function to adjust veil when window is resized
  68.  
  69. if (this.interVeil && this.interVeil.style.display=="block") //If veil is currently visible on the screen
  70.  
  71. this.loadveil() //readjust veil
  72.  
  73. },
  74.  
  75.  
  76.  
  77. closeveil:function(){ //function to close veil
  78.  
  79. this.veilstack--
  80.  
  81. if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed
  82.  
  83. this.interVeil.style.display="none"
  84.  
  85. },
  86.  
  87.  
  88.  
  89.  
  90.  
  91. close:function(t, forceclose){ //DHTML modal close function
  92.  
  93. t.contentDoc=(t.contentarea.datatype=="iframe")? window.frames["_iframe-"+t.id].document : t.contentarea //return reference to modal window DIV (or document object in the case of iframe
  94.  
  95. if (typeof forceclose!="undefined")
  96.  
  97. t.onclose=function(){return true}
  98.  
  99. if (dhtmlwindow.close(t)) //if close() returns true
  100.  
  101. this.closeveil()
  102.  
  103. },
  104.  
  105.  
  106.  
  107.  
  108.  
  109. show:function(t){
  110.  
  111. dhtmlmodal.veilstack++
  112.  
  113. dhtmlmodal.loadveil()
  114.  
  115. dhtmlwindow.show(t)
  116.  
  117. }
  118.  
  119. } //END object declaration
  120.  
  121.  
  122.  
  123.  
  124.  
  125. document.write('<div id="interVeil"></div>')
  126.  
  127. dhtmlwindow.addEvent(window, function(){if (typeof dhtmlmodal!="undefined") dhtmlmodal.adjustveil()}, "resize")
Ociu
Proszę nadać jakiś sensowny tytuł tematowi.
bambolo
Nikt nie wie sad.gif nawet nikomu nie chce sie napisac google szukaj smile.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.