Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne]Ciasteczka wyswietlanie ifreme o okreslonym czasie
bambolo
post 17.10.2009, 06:39:59
Post #1





Grupa: Zarejestrowani
Postów: 135
Pomógł: 0
Dołączył: 10.02.2007

Ostrzeżenie: (10%)
X----


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")


Ten post edytował bambolo 17.10.2009, 10:25:37
Go to the top of the page
+Quote Post
Ociu
post 17.10.2009, 10:22:24
Post #2





Grupa: Moderatorzy
Postów: 1 566
Pomógł: 37
Dołączył: 14.05.2003
Skąd: Kraków




Proszę nadać jakiś sensowny tytuł tematowi.
Go to the top of the page
+Quote Post
bambolo
post 17.10.2009, 14:09:29
Post #3





Grupa: Zarejestrowani
Postów: 135
Pomógł: 0
Dołączył: 10.02.2007

Ostrzeżenie: (10%)
X----


Nikt nie wie sad.gif nawet nikomu nie chce sie napisac google szukaj smile.gif
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 03:46