SlideIntoView Control
Life With Nate
Nate's Poetry Page
Resume (PDF)
Nate's Code
ASP.NET 2.0/3.5
ButtonExtensions
ConditionalRequiredTextValidator
CSSImageMap
CustomStyle
DateTimePicker
DateTimePickerTemplated
LengthValidator
RestrictInputTextBox
RestrictInputValidator
Rollovers
RotatedTextHandler
RotatedTextImage
Rotators
SelectedCountValidator
SlideIntoView
StatesDropDownList
UniqueValueValidatorBase
VB.NET 2.0/3.5
Just For Fun
Windows Phone 7
Description
The SlideIntoView control allows you to create a template that will slide, after an optional delay, from one position to another.
Example
The following tags were used to create the SlideIntoView above:
<NJS:SlideIntoView ID="sivExample" runat="server" Width="500" Height="300" HorizontalData-Delay="Delayed" HorizontalData-DelayTime="2500" HorizontalData-Direction="RightToLeft" HorizontalData-StartPosition="500" StationaryStyle="background-color:green;" SlidingStyle="background-color:red;" VerticalData-Delay="Delayed" VerticalData-DelayTime="2500" VerticalData-Direction="TopToBottom" VerticalData-StartPosition="-300"> <ContentTemplate> <img src="/images/frog.gif" style="margin:0px;padding:0px;border-width:0px;width:48px;height:48px;"/><br/> <img src="/images/explanationicon.gif" style="margin:0px 0px 0px 48px;padding:0px;border-width:0px;width:53px;height:51px;"/><br/> <img src="/images/rotatefrog.gif" style="margin:0px 0px 0px 101px;padding:0px;border-width:0px;width:48px;height:48px;"/><br/> <img src="/images/quoteicon.gif" style="margin:0px 0px 0px 149px;padding:0px;border-width:0px;width:54px;height:39px;"/> </ContentTemplate> </NJS:SlideIntoView>
Properties & Methods
SlideIntoView
The SlideIntoView control allows you to create a template that will slide, after an optional delay, from one position to another
Width
- The width, in pixels, of the two divs, one of which is stationary, the other of which slides from one position to another (default=500)
Height
- The height, in pixels, of the two divs, one of which is stationary, the other of which slides from one position to another (default=300)
StationaryStyle
- The css that is applied to the div that does not move
SlidingStyle
- The css that is applied to the div that will be sliding
ContentTemplate
- The ITemplate that contains the controls that will go inside the sliding div
HorizontalData
- An instance of the SlideIntoView.HorizontalSlideData class that contains information about the horizontal movement
VerticalData
- An instance of the SlideIntoView.VerticalSlideData class that contains information about the vertical movement
OnSlideComplete
- A String of JavaScript that will be executed once the template has finished sliding in both the horizontal and vertical directions
SlideJavaScript
- A ReadOnly property that returns JavaScript that can be used to reset the sliding div to it's initial position and start it sliding again. Any delays specified will not be applied here
SlideWithDelayJavaScript
- A ReadOnly property that returns JavaScript that can be used to reset the sliding div to it's initial position and start it sliding again. If you specified delays, they will be applied here
SlideHorizontalJavaScript
- A ReadOnly property that returns JavaScript that can be used to reset the sliding div to it's initial horizontal position and start it sliding again in the horizontal direction. Any delays specified will not be applied here
SlideHorizontalWithDelayJavaScript
- A ReadOnly property that returns JavaScript that can be used to reset the sliding div to it's initial horizontal position and start it sliding again in the horizontal direction. If you specified a horizontal delay, it will be applied here
SlideVerticalJavaScript
- A ReadOnly property that returns JavaScript that can be used to reset the sliding div to it's initial vertical position and start it sliding again in the vertical direction. Any delays specified will not be applied here
SlideVerticalWithDelayJavaScript
- A ReadOnly property that returns JavaScript that can be used to reset the sliding div to it's initial vertical position and start it sliding again in the vertical direction. If you specified a vertical delay, it will be applied here
SlideIntoView.HorizontalDirectionEnum As Byte
An enumeration used to specify what direction the sliding div will be moving in horizontally
None
- The sliding div will not be moving horizontally
LeftToRight
- The sliding div will slide from left to right
RightToLeft
- The sliding div will slide from right to left
SlideIntoView.VerticalDirectionEnum As Byte
An enumeration used to specify what direction the sliding div will be moving in vertically
None
- The sliding div will not be moving vertically
TopToBottom
- The sliding div will slide from top to bottom
BottomToTop
- The sliding div will slide from bottom to top
SlideIntoView.SlideDelayEnum As Byte
An enumeration used to specify when the sliding div starts sliding
Immediately
- The sliding div will start sliding once the page is loaded
Delayed
- The sliding div will start sliding after the number of milliseconds specified in SlideIntoView.HorizontalData.DelayTime or SlideIntoView.VerticalData.DelayTime
Manual
- The sliding div will not start sliding in the current direction unless the JavaScript from one of the appropriate properties is called
SlideIntoView.SlideData
A class that contains the base properties used to specify information about the sliding of the divs. This class is inherited by SlideIntoView.HorizontalSlideData and SlideIntoView.VerticalSlideData
Delay
- A value from the SlideIntoView.SlideDelayEnum enumeration to specify when the sliding div starts sliding (default=Immediately)
DelayTime
- If Delay=Delayed, the amount of time, in milliseconds, before the sliding div starts sliding (default=0)
Interval
- The amount of time, in milliseconds, between changes in position of the sliding div (default=1)
StepLength
- The number of pixels the sliding div will move at a time (default=1)
EndPosition
- The position, relative to the non-sliding div, that the sliding div will stop sliding. This can be a positive or negative number (default=0)
StartPosition
- The position, relative to the non-sliding div, that the sliding div will start sliding from. This can be a positive or negative number (default=0)
OnSlideComplete
- A String of JavaScript that will be executed once the template has finished sliding in the current direction
SlideIntoView.HorizontalSlideData
A class that inherits from SlideIntoView.SlideData for use with horizontally sliding divs
Direction
- A value from the SlideIntoView.HorizontalDirectionEnum enumeration to specify what direction the sliding div will be moving in horizontally (default=None)
SlideIntoView.VerticalSlideData
A class that inherits from SlideIntoView.SlideData for use with vertically sliding divs
Direction
- A value from the SlideIntoView.VerticalDirectionEnum enumeration to specify what direction the sliding div will be moving in vertically (default=None)
Source Code
SlideIntoView.vb:
Namespace NathanSokalski <ParseChildren(True), _ System.Drawing.ToolboxBitmap(GetType(ToolboxIcons), "SlideIntoView.bmp")> _ Public Class SlideIntoView : Inherits System.Web.UI.Control : Implements INamingContainer Private outerdiv As New HtmlGenericControl("div") Private innerdiv As New HtmlGenericControl("div") Private _stationarystyle As String = String.Empty Private _slidingstyle As String = String.Empty Private _width As Short = 500 Private _height As Short = 300 Private _contenttemplate As ITemplate Private _horizontaldata As New NathanSokalski.SlideIntoView.HorizontalSlideData Private _verticaldata As New NathanSokalski.SlideIntoView.VerticalSlideData Private _onslidecomplete As String <DefaultValue(""), Description("Additional CSS applied to the non-moving div")> Public Property StationaryStyle() As String Get Return Me._stationarystyle End Get Set(ByVal value As String) Me._stationarystyle = value End Set End Property <DefaultValue(""), Description("Additional CSS applied to the div containing the template")> Public Property SlidingStyle() As String Get Return Me._slidingstyle End Get Set(ByVal value As String) Me._slidingstyle = value End Set End Property <DefaultValue(500), Description("The width of the visible area in pixels")> Public Property Width() As Short Get Return Me._width End Get Set(ByVal value As Short) Me._width = value End Set End Property <DefaultValue(300), Description("The height of the visible area in pixels")> Public Property Height() As Short Get Return Me._height End Get Set(ByVal value As Short) Me._height = value End Set End Property <TemplateContainer(GetType(SlideIntoView)), PersistenceMode(PersistenceMode.InnerProperty)> Public Property ContentTemplate() As ITemplate Get Return Me._contenttemplate End Get Set(ByVal value As ITemplate) Me._contenttemplate = value End Set End Property <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> Public Property HorizontalData() As NathanSokalski.SlideIntoView.HorizontalSlideData Get Return Me._horizontaldata End Get Set(ByVal value As NathanSokalski.SlideIntoView.HorizontalSlideData) Me._horizontaldata = value End Set End Property <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> Public Property VerticalData() As NathanSokalski.SlideIntoView.VerticalSlideData Get Return Me._verticaldata End Get Set(ByVal value As NathanSokalski.SlideIntoView.VerticalSlideData) Me._verticaldata = value End Set End Property <Description("JavaScript code to execute when the template has finished sliding in both directions")> Public Property OnSlideComplete() As String Get Return Me._onslidecomplete End Get Set(ByVal value As String) Me._onslidecomplete = value End Set End Property <Description("JavaScript code used to start sliding the template in the horizontal direction"), Browsable(False)> Public ReadOnly Property SlideHorizontalJavaScript() As String Get Return String.Format("SetInnerDivStyle('{0}','width:{1}px;height:{2}px;margin:0px 0px 0px {3}px;padding:0px;border-width:0px;');{0}_data.SlideHorizontal();", Me.innerdiv.ClientID(), Me._width, Me._height, Me.HorizontalData.StartPosition) End Get End Property <Description("JavaScript code used to start sliding the template in the vertical direction"), Browsable(False)> Public ReadOnly Property SlideVerticalJavaScript() As String Get Return String.Format("SetInnerDivStyle('{0}','width:{1}px;height:{2}px;margin:{3}px 0px 0px 0px;padding:0px;border-width:0px;');{0}_data.SlideVertical();", Me.innerdiv.ClientID(), Me._width, Me._height, Me.VerticalData.StartPosition) End Get End Property <Description("JavaScript code used to start sliding the template in the horizontal and vertical directions"), Browsable(False)> Public ReadOnly Property SlideJavaScript() As String Get Return String.Format("SetInnerDivStyle('{0}','width:{1}px;height:{2}px;margin:{3}px 0px 0px {4}px;padding:0px;border-width:0px;');{0}_data.Slide();", Me.innerdiv.ClientID(), Me._width, Me._height, Me.VerticalData.StartPosition, Me.HorizontalData.StartPosition) End Get End Property <Description("JavaScript code used to start sliding the template in the horizontal direction after the delay set in HorizontalData.DelayTime()"), Browsable(False)> Public ReadOnly Property SlideHorizontalWithDelayJavaScript() As String Get Return String.Format("SetInnerDivStyle('{0}','width:{1}px;height:{2}px;margin:0px 0px 0px {3}px;padding:0px;border-width:0px;');{0}_data.SlideHorizontalWithDelay();", Me.innerdiv.ClientID(), Me._width, Me._height, Me.HorizontalData.StartPosition) End Get End Property <Description("JavaScript code used to start sliding the template in the vertical direction after the delay set in VerticalData.DelayTime()"), Browsable(False)> Public ReadOnly Property SlideVerticalWithDelayJavaScript() As String Get Return String.Format("SetInnerDivStyle('{0}','width:{1}px;height:{2}px;margin:{3}px 0px 0px 0px;padding:0px;border-width:0px;');{0}_data.SlideVerticalWithDelay();", Me.innerdiv.ClientID(), Me._width, Me._height, Me.VerticalData.StartPosition) End Get End Property <Description("JavaScript code used to start sliding the template in the horizontal and vertical directions after the delays set in HorizontalData.DelayTime() and VerticalData.DelayTime()"), Browsable(False)> Public ReadOnly Property SlideWithDelayJavaScript() As String Get Return String.Format("SetInnerDivStyle('{0}','width:{1}px;height:{2}px;margin:{3}px 0px 0px {4}px;padding:0px;border-width:0px;');{0}_data.SlideWithDelay();", Me.innerdiv.ClientID(), Me._width, Me._height, Me.VerticalData.StartPosition, Me.HorizontalData.StartPosition) End Get End Property Private Sub Ctrl_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init Me.EnableViewState = False Me.innerdiv.ID = String.Concat(Me.ClientID(), "_innerdiv") Me.outerdiv.ID = String.Concat(Me.ClientID(), "_outerdiv") End Sub Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) 'Add and render controls Me._contenttemplate.InstantiateIn(Me.innerdiv) Me.outerdiv.Controls.Add(Me.innerdiv) Me.outerdiv.RenderControl(writer) End Sub Private Sub Ctrl_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender 'Add style classes for the divs Me.Page.Header.StyleSheet.CreateStyleRule(New CustomStyle(String.Format("width:{0}px;height:{1}px;margin:0px;padding:0px;overflow:hidden;border-width:0px;", Me._width, Me._height)), Nothing, String.Concat("div#", Me.outerdiv.ClientID())) Me.Page.Header.StyleSheet.CreateStyleRule(New CustomStyle(String.Format("width:{0}px;height:{1}px;margin:{2}px 0px 0px {3}px;padding:0px;border-width:0px;", Me._width, Me._height, Me._verticaldata.StartPosition, Me._horizontaldata.StartPosition)), Nothing, String.Concat("div#", Me.innerdiv.ClientID())) Me.Page.ClientScript.RegisterClientScriptResource(Me.GetType(), "SlideIntoView.js") Dim ctrldata As New System.Text.StringBuilder() ctrldata.AppendFormat("var {0}_data=new SlideIntoViewData(", Me.innerdiv.ClientID()) ctrldata.AppendFormat("'{0}'", Me.innerdiv.ClientID()) ctrldata.AppendFormat(",'{0}'", Me.outerdiv.ClientID()) ctrldata.AppendFormat(",'{0}'", Me._stationarystyle) ctrldata.AppendFormat(",'{0}'", Me._slidingstyle) ctrldata.AppendFormat(",{0}", Me._horizontaldata.StartPosition) ctrldata.AppendFormat(",{0}", Me._horizontaldata.EndPosition) ctrldata.AppendFormat(",'{0}'", Me._horizontaldata.Direction.ToString()) ctrldata.AppendFormat(",{0}", Me._horizontaldata.StepLength) ctrldata.AppendFormat(",{0}", Me._horizontaldata.Interval) ctrldata.AppendFormat(",{0}", Me._horizontaldata.DelayTime) ctrldata.AppendFormat(",function(){{{0}}}", Me.HorizontalData.OnSlideComplete()) ctrldata.AppendFormat(",{0}", Me._verticaldata.StartPosition) ctrldata.AppendFormat(",{0}", Me._verticaldata.EndPosition) ctrldata.AppendFormat(",'{0}'", Me._verticaldata.Direction.ToString()) ctrldata.AppendFormat(",{0}", Me._verticaldata.StepLength) ctrldata.AppendFormat(",{0}", Me._verticaldata.Interval) ctrldata.AppendFormat(",{0}", Me._verticaldata.DelayTime) ctrldata.AppendFormat(",function(){{{0}}}", Me.VerticalData.OnSlideComplete()) ctrldata.AppendFormat(",function(){{{0}}}", Me._onslidecomplete) ctrldata.AppendLine(");") Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), String.Format("{0}_data", Me.innerdiv.ClientID()), ctrldata.ToString(), True) Dim startcode As String = String.Empty Select Case Me._horizontaldata.Delay Case SlideDelayEnum.Immediately Select Case Me._verticaldata.Delay Case SlideDelayEnum.Immediately : startcode = Me.SlideJavaScript() Case SlideDelayEnum.Delayed : startcode = String.Concat(Me.SlideHorizontalJavaScript(), Me.SlideVerticalWithDelayJavaScript()) Case SlideDelayEnum.Manual : startcode = Me.SlideHorizontalJavaScript() End Select Case SlideDelayEnum.Delayed Select Case Me._verticaldata.Delay Case SlideDelayEnum.Immediately : startcode = Me.SlideHorizontalWithDelayJavaScript() Case SlideDelayEnum.Delayed : startcode = Me.SlideWithDelayJavaScript() Case SlideDelayEnum.Manual : startcode = Me.SlideHorizontalWithDelayJavaScript() End Select Case SlideDelayEnum.Manual Select Case Me._verticaldata.Delay Case SlideDelayEnum.Immediately : startcode = Me.SlideVerticalJavaScript() Case SlideDelayEnum.Delayed : startcode = Me.SlideVerticalWithDelayJavaScript() Case SlideDelayEnum.Manual : startcode = String.Empty End Select End Select Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), String.Format("{0}_startcode", Me.innerdiv.ClientID()), startcode, True) End Sub Public Enum HorizontalDirectionEnum As Byte None LeftToRight RightToLeft End Enum Public Enum VerticalDirectionEnum As Byte None TopToBottom BottomToTop End Enum Public Enum SlideDelayEnum As Byte Immediately Delayed Manual End Enum <TypeConverter(GetType(ExpandableObjectConverter)), Serializable()> Public Class SlideData Private _delay As NathanSokalski.SlideIntoView.SlideDelayEnum = SlideIntoView.SlideDelayEnum.Immediately Private _delaytime As Integer = 0 Private _interval As Short = 1 Private _step As Short = 1 Private _endposition As Short = 0 Private _startposition As Short = 0 Private _onslidecomplete As String <DefaultValue("Immediately"), Description("Specifies when the template will begin moving"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property Delay() As NathanSokalski.SlideIntoView.SlideDelayEnum Get Return Me._delay End Get Set(ByVal value As NathanSokalski.SlideIntoView.SlideDelayEnum) Me._delay = value End Set End Property <DefaultValue(0), Description("Specifies the number of milliseconds before the template will begin moving"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property DelayTime() As Integer Get Return Me._delaytime End Get Set(ByVal value As Integer) Me._delaytime = value End Set End Property <DefaultValue(1), Description("The number of milliseconds between changes in position"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property Interval() As Short Get Return Me._interval End Get Set(ByVal value As Short) Me._interval = value End Set End Property <DefaultValue(1), Description("The number of pixels the template will move at a time"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property StepLength() As Short Get Return Me._step End Get Set(ByVal value As Short) Me._step = value End Set End Property <DefaultValue(0), Description("The position at which the template will stop moving"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property EndPosition() As Short Get Return Me._endposition End Get Set(ByVal value As Short) Me._endposition = value End Set End Property <DefaultValue(0), Description("The initial position of the template"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property StartPosition() As Short Get Return Me._startposition End Get Set(ByVal value As Short) Me._startposition = value End Set End Property <Description("JavaScript to be executed once the template has reached it's final position"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property OnSlideComplete() As String Get Return Me._onslidecomplete End Get Set(ByVal value As String) Me._onslidecomplete = value End Set End Property End Class <TypeConverter(GetType(ExpandableObjectConverter)), Serializable()> Public Class HorizontalSlideData : Inherits SlideData Private _direction As NathanSokalski.SlideIntoView.HorizontalDirectionEnum = SlideIntoView.HorizontalDirectionEnum.None <DefaultValue("None"), Description("The horizontal direction the template will be moved"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property Direction() As NathanSokalski.SlideIntoView.HorizontalDirectionEnum Get Return Me._direction End Get Set(ByVal value As NathanSokalski.SlideIntoView.HorizontalDirectionEnum) Me._direction = value End Set End Property End Class <TypeConverter(GetType(ExpandableObjectConverter)), Serializable()> Public Class VerticalSlideData : Inherits SlideData Private _direction As NathanSokalski.SlideIntoView.VerticalDirectionEnum = SlideIntoView.VerticalDirectionEnum.None <DefaultValue("None"), Description("The vertical direction the template will be moved"), RefreshProperties(RefreshProperties.All), NotifyParentProperty(True)> Public Property Direction() As NathanSokalski.SlideIntoView.VerticalDirectionEnum Get Return Me._direction End Get Set(ByVal value As NathanSokalski.SlideIntoView.VerticalDirectionEnum) Me._direction = value End Set End Property End Class End Class End Namespace
SlideIntoView.js:
function SlideIntoView(ctrldata,direction,steplength) { var doslide,parsemargin; switch(direction) { case "LeftToRight": parsemargin=parseInt(document.getElementById(ctrldata.innerdiv).style.marginLeft); doslide=parsemargin<ctrldata.horizontalendposition; break; case "RightToLeft": parsemargin=parseInt(document.getElementById(ctrldata.innerdiv).style.marginLeft); doslide=parsemargin>ctrldata.horizontalendposition; break; case "TopToBottom": parsemargin=parseInt(document.getElementById(ctrldata.innerdiv).style.marginTop); doslide=parsemargin<ctrldata.verticalendposition; break; case "BottomToTop": parsemargin=parseInt(document.getElementById(ctrldata.innerdiv).style.marginTop); doslide=parsemargin>ctrldata.verticalendposition; break; } if(doslide) { switch(direction) { case "LeftToRight": if(parsemargin+steplength>ctrldata.horizontalendposition){steplength=ctrldata.horizontalendposition-parsemargin;} document.getElementById(ctrldata.innerdiv).style.marginLeft=parsemargin+steplength+"px";break; case "RightToLeft": if(parsemargin-steplength<ctrldata.horizontalendposition){steplength=parsemargin-ctrldata.horizontalendposition;} document.getElementById(ctrldata.innerdiv).style.marginLeft=parsemargin-steplength+"px";break; case "TopToBottom": if(parsemargin+steplength>ctrldata.verticalendposition){steplength=ctrldata.verticalendposition-parsemargin;} document.getElementById(ctrldata.innerdiv).style.marginTop=parsemargin+steplength+"px";break; case "BottomToTop": if(parsemargin-steplength<ctrldata.verticalendposition){steplength=parsemargin-ctrldata.verticalendposition;} document.getElementById(ctrldata.innerdiv).style.marginTop=parsemargin-steplength+"px";break; } } else { switch(direction) { case "LeftToRight": case "RightToLeft": { window.clearInterval(ctrldata.horizontalintervalid); ctrldata.horizontalcompleted=true; ctrldata.horizontalscript(); break; } case "TopToBottom": case "BottomToTop": { window.clearInterval(ctrldata.verticalintervalid); ctrldata.verticalcompleted=true; ctrldata.verticalscript(); break; } } if(ctrldata.horizontalcompleted&&ctrldata.verticalcompleted){{ctrldata.finalscript();}} } } //Constructor for SlideIntoViewData function SlideIntoViewData(innerdiv,outerdiv,stationarystyle,slidingstyle,horizontalstartposition,horizontalendposition,horizontaldirection,horizontalsteplength,horizontalinterval,horizontaldelaytime,horizontalscript,verticalstartposition,verticalendposition,verticaldirection,verticalsteplength,verticalinterval,verticaldelaytime,verticalscript,finalscript) { this.innerdiv=innerdiv; this.outerdiv=outerdiv; this.stationarystyle=stationarystyle; this.slidingstyle=slidingstyle; this.horizontalstartposition=horizontalstartposition; this.horizontalendposition=horizontalendposition; this.horizontaldirection=horizontaldirection; this.horizontalsteplength=horizontalsteplength; this.horizontalinterval=horizontalinterval; this.horizontaldelaytime=horizontaldelaytime; this.horizontalintervalid=null; this.horizontalcompleted=true; this.horizontalscript=horizontalscript; this.verticalstartposition=verticalstartposition; this.verticalendposition=verticalendposition; this.verticaldirection=verticaldirection; this.verticalsteplength=verticalsteplength; this.verticalinterval=verticalinterval; this.verticaldelaytime=verticaldelaytime; this.verticalintervalid=null; this.verticalcompleted=true; this.verticalscript=verticalscript; this.finalscript=finalscript; } //Code used by SlideHorizontal and SlideHorizontalWithDelay SlideIntoViewData.prototype.SlideHorizontalInit=function() { this.horizontalcompleted=this.horizontaldirection=='None'; document.getElementById(this.outerdiv).style.cssText=this.stationarystyle; document.getElementById(this.innerdiv).style.cssText=this.slidingstyle; document.getElementById(this.innerdiv).style.marginLeft=this.horizontalstartposition+'px'; } //Code used by SlideVertical and SlideVerticalWithDelay SlideIntoViewData.prototype.SlideVerticalInit=function() { this.verticalcompleted=this.verticaldirection=='None'; document.getElementById(this.outerdiv).style.cssText=this.stationarystyle; document.getElementById(this.innerdiv).style.cssText=this.slidingstyle; document.getElementById(this.innerdiv).style.marginTop=this.verticalstartposition+'px'; } //Start sliding in the horizontal direction with no delay SlideIntoViewData.prototype.SlideHorizontal=function() { this.SlideHorizontalInit(); if(this.horizontaldirection!='None'){this.horizontalintervalid=window.setInterval('SlideIntoView('+this.innerdiv+'_data,'+this.innerdiv+'_data.horizontaldirection,'+this.innerdiv+'_data.horizontalsteplength)',this.horizontalinterval);} } //Start sliding in the vertical direction with no delay SlideIntoViewData.prototype.SlideVertical=function() { this.SlideVerticalInit(); if(this.verticaldirection!='None'){this.verticalintervalid=window.setInterval('SlideIntoView('+this.innerdiv+'_data,'+this.innerdiv+'_data.verticaldirection,'+this.innerdiv+'_data.verticalsteplength)',this.verticalinterval);} } //Start sliding in the horizontal and vertical directions with no delay SlideIntoViewData.prototype.Slide=function() { this.horizontalcompleted=this.horizontaldirection=='None'; this.verticalcompleted=this.verticaldirection=='None'; document.getElementById(this.outerdiv).style.cssText=this.stationarystyle; document.getElementById(this.innerdiv).style.cssText=this.slidingstyle; document.getElementById(this.innerdiv).style.marginLeft=this.horizontalstartposition+'px'; document.getElementById(this.innerdiv).style.marginTop=this.verticalstartposition+'px'; if(this.horizontaldirection!='None'){this.horizontalintervalid=window.setInterval('SlideIntoView('+this.innerdiv+'_data,'+this.innerdiv+'_data.horizontaldirection,'+this.innerdiv+'_data.horizontalsteplength)',this.horizontalinterval);} if(this.verticaldirection!='None'){this.verticalintervalid=window.setInterval('SlideIntoView('+this.innerdiv+'_data,'+this.innerdiv+'_data.verticaldirection,'+this.innerdiv+'_data.verticalsteplength)',this.verticalinterval);} } //Start sliding in the horizontal direction with a delay SlideIntoViewData.prototype.SlideHorizontalWithDelay=function() { this.SlideHorizontalInit(); if(this.horizontaldirection!='None'){setTimeout(this.innerdiv+"_data.horizontalintervalid=window.setInterval('SlideIntoView("+this.innerdiv+"_data,"+this.innerdiv+"_data.horizontaldirection,"+this.innerdiv+"_data.horizontalsteplength)',"+this.innerdiv+"_data.horizontalinterval)",this.horizontaldelaytime);} } //Start sliding in the vertical direction with a delay SlideIntoViewData.prototype.SlideVerticalWithDelay=function() { this.SlideVerticalInit(); if(this.verticaldirection!='None'){setTimeout(this.innerdiv+"_data.verticalintervalid=window.setInterval('SlideIntoView("+this.innerdiv+"_data,"+this.innerdiv+"_data.verticaldirection,"+this.innerdiv+"_data.verticalsteplength)',"+this.innerdiv+"_data.verticalinterval)",this.verticaldelaytime);} } //Start sliding in the horizontal and vertical directions with a delay SlideIntoViewData.prototype.SlideWithDelay=function() { this.horizontalcompleted=this.horizontaldirection=='None'; this.verticalcompleted=this.verticaldirection=='None'; document.getElementById(this.outerdiv).style.cssText=this.stationarystyle; document.getElementById(this.innerdiv).style.cssText=this.slidingstyle; document.getElementById(this.innerdiv).style.marginLeft=this.horizontalstartposition+'px'; document.getElementById(this.innerdiv).style.marginTop=this.verticalstartposition+'px'; if(this.horizontaldirection!='None'){setTimeout(this.innerdiv+"_data.horizontalintervalid=window.setInterval('SlideIntoView("+this.innerdiv+"_data,"+this.innerdiv+"_data.horizontaldirection,"+this.innerdiv+"_data.horizontalsteplength)',"+this.innerdiv+"_data.horizontalinterval)",this.horizontaldelaytime);} if(this.verticaldirection!='None'){setTimeout(this.innerdiv+"_data.verticalintervalid=window.setInterval('SlideIntoView("+this.innerdiv+"_data,"+this.innerdiv+"_data.verticaldirection,"+this.innerdiv+"_data.verticalsteplength)',"+this.innerdiv+"_data.verticalinterval)",this.verticaldelaytime);} } //Change the stylesheet rule when using the JavaScript methods to start sliding function SetInnerDivStyle(innerdivid,innerdivstyle) { var rules; for(var i=0;i<document.styleSheets.length;i++) { rules=document.styleSheets[i].cssRules?document.styleSheets[i].cssRules:document.styleSheets[i].rules; for(var j=0;j<rules.length;j++){if(rules[j].selectorText.toUpperCase()=='DIV#'+innerdivid.toUpperCase()){rules[j].style.cssText=innerdivstyle;return;}} } }