Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <title>JW Image Rotator Dynamic Playlist DEMO</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <!-- Version 3.18 is available. Version 3.17 which contains no watermark and ALL source files is available here: http://developer.longtailvideo.com/trac/browser/tags/imagerotator-3.17 -->
- <!-- All the flashVars, params, API useage is available here: http://developer.longtailvideo.com/trac/wiki/ImageRotatorOverview -->
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
- <style type="text/css">
- /* This is the only style required which specifies the dimensions for the Image Rotator when it Reloads. */
- .iRotatorWrapper320x180 {
- width: 320px;
- height: 180px;
- background-color: #000000;
- }
- </style>
- <script type="text/javascript">
- // This variable will define the default playlist.
- // When the webpage admin updates the contents of this file, it's then available for the currently loaded player during a Reload event.
- //
- // Remember to replaced hot linked files with your own... shown on jsFiddle for DEMO only.
- // Original non-jsFiddle filename would be: playlist.xml
- //
- var iRotatorXML01 = "http://www.longtailvideo.com/jw/embed/images.php";
- // This function defines the first Image Rotator Object which is initalized using name iRotatorInit01
- function iRotatorInit01(){
- // This section defines the SWFobject flashVars Options for the Image Rotator Object defined above.
- var flashVars = {
- 'file': iRotatorXML01,
- 'shownavigation': 'true',
- 'shuffle': 'false',
- 'repeat': 'true',
- 'rotatetime': '2'
- };
- // This section defines the SWFobject params Options for the Image Rotator Object defined above.
- var params = {
- "allowfullscreen": "true",
- "allowscriptaccess": "always",
- "wmode": "transparent"
- };
- // This section defines the SWFobject attributes Options for the Image Rotator Object defined above.
- // The id and name must match, and these should match the div name for best performance.
- var attributes ={
- "id": "iRotatorEmbed01",
- "name": "iRotatorEmbed01",
- "align": "middle"
- };
- // The SWFobject handles the cross-browser embedding.
- // The main imagerotator.swf file is used with handler of iRotatorEmbed01 which must match the DIV along with name/id in attributes.
- // The width and height are both 100% since the DIV #iRotatorWrapper defines the dimensions.
- // Min flash version 9 specified while false skips alternate flash content to be shown when required.
- // Finally, the three variables flashVars, params, and attributes will load the relivant data supplied from these variables.
- //
- // Remember to replaced hot linked files with your own... shown on jsFiddle for DEMO only.
- // Original non-jsFiddle filename would be: imagerotator.swf
- //
- swfobject.embedSWF("http://www.longtailvideo.com/jw/embed/imagerotator.swf", "iRotatorEmbed01", "100%", "100%", "9", "false", flashVars, params, attributes);
- }
- // This function will see that the current iRotator01 Object is reloaded.
- function iRotatorReload01(){
- // Optionally change the playlist filename to some other one by redefining this variable.
- // If filename is left as original or this variable is commented out, then the latest **revision** is used during this Reload event.
- // While only the 'file' flashVars is changed, this process can be applied to other flashVars, params, or attributes as required.
- // Also, related content can be handles during this reloading process, such as changing the title for the wrapper div.
- //
- // Remember to replaced hot linked files with your own... shown on jsFiddle for DEMO only.
- // Original non-jsFiddle filename would be: playlist2.xml
- //
- iRotatorXML01 = 'http://www.longtailvideo.com/jw/embed/images.php';
- // The contents of the iRotator01 DIV is emptied since it's about to be reinitialized.
- $('#iRotator01').empty();
- // This will reinitialize the iRotator01 DIV, thus re-loading the xml file which is either a new revision or new filename.
- iRotatorInit01();
- // Status message to indicate the iRotator01 Object was reloaded.
- console.log('The iRotatorEmbed01 was reloaded.');
- console.log('This DEMO has completed!');
- }
- window.onload=function(){
- // This will initialize the iRotator01 for the first time.
- iRotatorInit01();
- // Reload the SWF in 7 seconds. The value is in milliseconds, so 1000 = 1 second.
- // Optionally, use a simple Cookie Script that can auto-fire this function at desired times, useful when different playlist's should be loaded at different times.
- setTimeout("iRotatorReload01();", 7000);
- // Status message that it has been initalized for the first time along with presenting the Object.
- console.log('The iRotatorEmbed01 was just initialized during page load.'); console.log( $('#iRotatorEmbed01') );
- }
- </script>
- </head>
- <body>
- <p>JW Image Rotator with Dynamic Data DEMO<br />
- Enable the console to view messages.</p>
- <!-- This Class Name can be reused for other iRotatorEmbed's that are on the webpage, or new styles can be made.-->
- <div class="iRotatorWrapper320x180">
- <!-- This div is the first embed of the Image Rotator Object. -->
- <div id="iRotatorEmbed01"></div>
- </div>
- <!-- Simple text to occupy space to show that elements don't move around since the iRotatorWrapper is used. -->
- <p>The above flash item is embedded with SWFObject v2.2<br /><br />
- Both playlists are the same and they have 13 images.<br />
- Playlist is shown for 7 seconds which shows up to the 3rd image.<br />
- Playlist is reloaded, thus resetting the image count.</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement