-
2 Nov 2011 2:37 PM #1
Answered: Answered setInterval help
Answered: Answered setInterval help
i whant win to show and hide with setInterval
i have this but i want it to repet show and hide
tankyou
Code:Ext.onReady(function() { var win = new Ext.Window({ width:800,y:'20', border:false, height: 450,closeAction: 'hide',modal : 'true',id : 'changeMsg' }); setTimeout(function() {win.show(Ext.getBody());}, 10000); setTimeout(function() {win.hide(Ext.getBody()); }, 20000); });
-
Best Answer Posted by skirtle
This sounds like a very strange thing to want to do but isn't it just this?
You could use win.isHidden() instead of a hidden variable depending on how you want it to respond to user-initiated hiding.Code:var hidden = true; setInterval(function() { if (hidden) { win.show(Ext.getBody()); } else { win.hide(Ext.getBody()); } hidden = !hidden; }, 10000);
-
2 Nov 2011 4:41 PM #2
This sounds like a very strange thing to want to do but isn't it just this?
You could use win.isHidden() instead of a hidden variable depending on how you want it to respond to user-initiated hiding.Code:var hidden = true; setInterval(function() { if (hidden) { win.show(Ext.getBody()); } else { win.hide(Ext.getBody()); } hidden = !hidden; }, 10000);
-
2 Nov 2011 4:57 PM #3
-
2 Nov 2011 5:05 PM #4
Sounds horrendous. In that case, the code might be something like this:i whant to use is to popup ads
every10 sec win show for 1 sec and win hide. after 10 sec win show again
Code:function show() { win.show(); setTimeout(hide, 1000); } function hide() { win.hide(); setTimeout(show, 10000); } hide();
-
2 Nov 2011 5:05 PM #5
tankyou its work
you are the king



-
2 Nov 2011 5:18 PM #6
my site is live sport streaming so thats what i whant
http://www.tvonsport.com/justin1/cha...e.html?monimoo
-
3 Nov 2011 6:54 AM #7Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote
