XWidgetSoft Forum
https://www.bbs.xwidget.com/

SlidePanel delay
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=4895
Page 1 of 1

Author:  masha [ August 2nd, 2014, 5:15 pm ]
Post subject:  SlidePanel delay

Hi.
I've made a slidepanel that goes down when the cursor point to the widget's active area (!SlidePanelInOut=MeteoPanel).
What should I make to slide the panel down only if the cursor remains on this area for, let us say, 3 seconds? And not immediately (+ switch animation) as it does now.

And to make the panel auto slide-in 5 sec. later?

Thanx.

Author:  hamid [ August 4th, 2014, 11:42 am ]
Post subject:  Re: SlidePanel delay

you can use below code in script code to do this:

Code:
var s1,s2

function widgetOnEnter()
{
   s1=setTimeout("slidergodown",3000)
}

function slidergodown()
{
   clearTimeout(s2)
   slidepanel1.Slided=1
   s2=setTimeout("slidergoup",5000)
}

function slidergoup()
{
   slidepanel1.Slided=0
}

function widgetOnLeave()
{
   clearTimeout(s1)
}

Note:
you should link [widgetOnEnter] and [widgetOnLeave] function names to the their events in the widget's events tab (Right Sidebar)



edit:
corrected some mistakes in code, plz reuse

Author:  masha [ August 6th, 2014, 6:32 am ]
Post subject:  Re: SlidePanel delay

hamid, Thank you.
After adding semicolons it's work fine.

Author:  hamid [ August 6th, 2014, 6:40 am ]
Post subject:  Re: SlidePanel delay

masha wrote:
After adding semicolons it's work fine.

i think javascript doesn't need semicolons,
so i'm confused, why it's not worked for you without it?
which version of windows are you using?
does it have any errors in designer's log?

Author:  masha [ August 7th, 2014, 6:02 am ]
Post subject:  Re: SlidePanel delay

Windows 7, all updates
Log error: Line # Char # expected ;

Anyway the problem with slider resolved. Thank you.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/