The Identification Number and Password fields need to be filled in. Moreover, you cannot send messages devoid of contents Adding further data is not allowed because this topic has been closed Select All topics Print You provided no password: you have to write it in the textfield beside the command delete for the topic you want to delete Are you sure you want to delete this comment? You did not cast a vote. You need to cast a vote by selecting a radio button. Impossible to proceed You must reload the page to view the updates Provide the project number Insufficient form parameters: you forgot to fill in some field/s
 
member picmember pic
 
Blog of A
 
Share on MySpace

Javascript Dhtml. Clip & Slide: The Complete 36 Slice And / Or Slide Layer Animations

Visitors: 5,238 Tagged by its author as: Internet Characters (in origin): 7,582 (pages: ~ 3)
Author: Em@il Permalink Cast your vote for this topic Printable version
OBJECTIVE: provide all the possibile dynamic ways to slice (clip) and/or slide a layer of an html web page onto another layer.  
 
This is a whole family of scores of functions: each of them emulates a class.  
You do not need them all: you may pick only the one(s) that you really mean to run on your actual pages:  
Inclusion of external snippet begins: !442
Preview: function offRL(id, speed, amount, size, onExitOptionalFunction, stop1, stop2){ if(id){ id=(typeof(id)=="object")? id.id: id; var variableName=id+"_clipper"; if(window[variableName] && window[variableName].isRunning){return;{; if(!id !document.getElementById(id)){return;{; var object=window[variableName]=new Object(); object['layer']=document.getElementById(id); object["id"]=id; var name="offRL"; object[name]=window[name]; object["last"]=name; object.isRunning=1; object['speed']=parseFloat(speed) 100; object['amount']=parseFloat(amount) 1; object['size']=parseFloat (...)
Above 35000 charactersTemporarily compressed content: click here to view it
 
Inclusion of external snippet begins: !443
Preview: function onBT(id, speed, amount, size, onExitOptionalFunction, stop1, stop2){ if(id){ id=(typeof(id)=="object")? id.id: id; var variableName=id+"_clipper"; if(window[variableName] && window[variableName].isRunning){return;{; if(!id !document.getElementById(id)){return;{; var object=window[variableName]=new Object(); object['layer']=document.getElementById(id); object["id"]=id; var name="onBT";// object[name]=window[name]; object["last"]=name; object.isRunning=1; object['speed']=parseFloat(speed) 100; object['amount']=parseFloat(amount) 1; object['size']=parseFloat (...)
Above 35000 charactersTemporarily compressed content: click here to view it
 
Inclusion of external snippet begins: !444
Preview: function sliceRL(id, speed, amount, size, onExitOptionalFunction, stop1, stop1){ if(id){ id=(typeof(id)=="object")? id.id: id; var variableName=id+"_clipper"; if(window[variableName] && window[variableName].isRunning){return;{; if(!id !document.getElementById(id)){return;{; var object=window[variableName]=new Object(); object['layer']=document.getElementById(id); object["id"]=id; var name="sliceRL";// object[name]=window[name]; object["last"]=name; object.isRunning=1; object['speed']=parseFloat(speed) 100; object['amount']=parseFloat(amount) 1; object['half']=obje (...)
Above 35000 charactersTemporarily compressed content: click here to view it
 
INPUTS: for all the functions these rules apply:  
 
id mandatory.  
This argument must be the id assigned to the layer.  
 
speed optional, defaults to 100 milliseconds.  
This argument is a number representing the speed in milliseconds of the clipping animation.  
 
amount optional, defaults to 1 (pixel).  
This argument is a number and determines how many pixels must be clipped at every round of the animation.  
 
size optional, defaults to half the width or height of the layer.  
This argument is a number and affects only the slicing clippers.  
 
onExitOptionalFunction optional, defaults to nothing.  
This argument is either number zero to bypass it, or number 1 to use a built in function that upon exiting firstly makes the layer invisible and then restores its original clipping values, or a function crafted by yourself.  
In this last case such function must be passed not as a string (that is, not in between quotes) but as the name of the function without the ending round brackets. If passed as such, this function crafted by yourself will be automatically invoked upon exiting the animation, and it accepts one argument - such argument will be passed to your function as the object that the method you used created upon initialization so that you can call from it all the properties such object holds as described in the next section, for instance you could craft a function like:  
function myFunction(object){//an example custom function  
object.setClip( object.originalClip ); //reset!  
alert( object.layer.style.visibility );  
}
 
For the clippers that make a layer appear, the built in function merely returns false, because I presume that if a layer has been clipped so to make it appear rather than disappear, you do not want it to be to be set to invisible and restored to its original clip values once the process is completed.  
 
stop1: an optional value to determine at which width to stop.  
If you want to bypass this argument, please do not use zero but the Javascript keyword false  
 
stop2: an optional value to determine at which height to stop.  
If you want to bypass this argument, please do not use zero but the Javascript keyword false.  
 
PROPERTIES:  
 
id: it is the layer id.  
 
layer: it is the layer node itself as an object, grabbed via getElementById.  
 
amount: a number representing the amount that is clipped at each iteration.  
 
size: a number, for the sliced layers, representing the size the slice must have (if the clipper clips top bottom, this size will represent a height, or if the clipper clips left right, this size will be a width).  
It defaults to half the width of the layer for the slicers that slice (clip) horizontally and to half the height of the layer for the slicers that slice (clip) vertically.  
 
speed: a number representing the milliseconds assigned to the animation speed.  
 
originalClip: the original clip of the layer as an array of four numbers:  
[top, right, bottom, left]  
 
originalLeft: the original left position of the layer (parseFloat it before use).  
 
originalTop: the original top position of the layer (parseFloat it before use)..  
 
getClip: a built in function: it returns the clip values.  
 
setClip: a built in function: it clips.  
 
stop: a built in function.  
 
timer: a variable holding the timer upon which a Javascript setInterval is assigned.  
 
stop1: an optional value to determine at which width to stop.  
If you want to bypass this argument, please do not use zero but the Javascript keyword false  
 
stop2: an optional value to determine at which height to stop.  
If you want to bypass this argument, please do not use zero but the Javascript keyword false.  
 
last: a string representing the name of the last clipper function run on it (it might be useful to know).  
 
onExitOptionalFunction: this is a function, crafted by yourself (although there is a default one as you will see) that will be called upon exiting the animation (that is, when the ending condition is met). It can be useful if for instance upon exiting you want the layer to be set to invisible and its clipping values restored to the initial ones. By the way, the css visibility property of a layer will be automatically set to visible every time an animation starts.  
RETURN: nothing.  
CAVEATS: Each layer that is meant to be clipped must have an ID declared.  
Upon running any of these functions onto a layer, the function will create (or recreate) a global (that is, window scoped) variable for each layer whose name will be in the shape: layerID_clipper whereas layerID will be the id assigned to the layer.  
 
If you want to start the clipping process on a layer that is already partially clipped at the beginning of the animation, this would cause no malfunction. However, you must define this clipping starting setting within the style property of the HTML tag, and not in any external style sheet.  
 
Your functions should not be called if your html layers are not fully parsed into the browser memory already.  
 
Example of use, with suitable html:
<div style="position:relative;width:406px;height:206px; border:#ff0000 3px solid; background-color:#dddddd;">
Container layer (relatively positioned) 400 x 200
	<div id="layerID" style="position:absolute; top:0px;left:0px; width:400px;height:200px; z-index:2; background-color:#ff3a0c; color:#000000; border:#000000 1px solid;padding:2px;">
	<span style="float:right; width:50px; height:200px;background-color:#0000ff;"></span>
	Contained layer (absolutely positioned) for css clip animation testing.<br />
	Dimensions: width 400px, height 200px
	</div>
</div>

<script>
/*do INCLUDE your function of choice here, in our case here would be psliceTB2 and then:*/

psliceTB2( 'layerID', 50/*speed*/, 3/*amount*/, 0/*size*/, 1/*or a function pointer*/, false, false ); 
</script>
Remove colors This text is protected by Copyright and cannot be reproduced, either in totality or in part, without the consent of the author. Also derivative works cannot be produced without the consent of the author.  
Minor excerpts may be quoted as long as a clearly readable link leading to this file is put in place soon after or soon before the quotation. Only the author has the right to reproduce in its totality this work on other servers.
If the text includes external snippets, you may hide their borders (useful for codes): click here
Printable version To exclude hyperlinks from the print, check the checkbox »
RSS

Cast your vote for this topic

To perform this operation it is not necessary to be Full Poster members.
«Negative Positive»
Click here to save your vote (Current average: 0, Voters: 0)
Are you the author of this topic and do you want to append quickly more text? click here
Other topics
Browse by category? »
This subscriber has snippets too: Read the snippets. Shoutbox: 103 reviews: 153 Visitors: 5,238
Overall visits to all the topics: 665,519
Daily average (Calculated from the website subscription day): 273.09
Optional sorting commands:
Normal order: click here
Order by amount of visits: click here
Order by most recently commented (attention: this will exclude from the returned results all the entries that have no comment): click here
Order by highest amount of comments (attention: this will exclude from the returned results all the entries that have no comment): click here
Order by vote (attention: this may exclude from the returned results all the entries that have no votes): click here
Current order: normal
Showing topics: 1, 10
Available total (with or without comments): 57
List topics by this author without this topic text: click here
Other topics available for this author: click on any title below to view the complete item:
You too may have your full fledged blog like this one, write your thoughts and interact with the Full Poster community, and it's all for free: Join.
External services
This page of this subscriber uses external services: Hide
Links to external blogs
The Disadvantages of an Elite Education
"I never learned that there are smart people who don't go to college at all." (Rating: 5)
THYLACINE'S LAIR
Now, you ought to read this. An amazing selected collection of thoughts from (apparently) various bloggers. (Rating: 4)
PsyBlog: Understand Your Mind
An interesting professional blog about psychology (not psychoanalysis though), with many articles. (Rating: 3)
SearchMe Dot Com
In my opinion the coolest idea for a search engine after Google: search results as screenshots leaves! (Rating: 3)
Mind Power News
Check the current or top issues links. Perhaps one of the more interesting collection of the motivation kind essays. (Rating: 4)
A Jolly Company: life, the universe, and medical residency
A nice blog about medical topics written by a doctor who... likes his patients! Medicine seen through human eyes. (Rating: 5)
Awesome Highlighter
Choose a web page of any site you want, underline the lines you prefer, save the generated file: nearly as a book! (Rating: 5)
Theres a Blog in my Soup
An interesting resource, with many links, about blogs and blogging. (Rating: 3)
Jakob Nielsen's Use It
An article that says why you ought to write long, elaborated blog entries. But the whole Useit site is interesting. (Rating: 3)
Coding Horror
One of the best blogs I recently found. Originality of thought, professionally criticizing blog cliches. Finally! (Rating: 4)
Encyclopedia Mythica
A very interesting resource for many of the gods and myths of several traditions. Worth a bookmark. (Rating: 3)
SeoTopic: Seo e Motori di Ricerca - Fabrizio Ventre
In italiano. Interesting blog on Search Engines and IT related topics. Enjoyable, well written, competent enough. (Rating: 3)
Spam Huntress
A blog deicated to investigating spam issues. It provides an interesting panorama on the wild west of the internet. (Rating: 4)
Creating Passionate Users
What science can tell us about the practice of making users passionate about their lives and tools (Rating: 3)
Tech Crunch
A weblog dedicated to obsessively profiling and reviewing new Internet products and companies (Rating: 3)
Advertise Space
Advertise Space is a blog dedicated to online adversting, buying and selling (Rating: 3)
 Comments area
Add A comment? click here
This list is currently empty or its edge has been surpassed. Back to the blog.