Changeset 983:594d50245ead
- Timestamp:
- 11/09/12 19:13:32 (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/jquery/jquery.constantfooter.js
r982 r983 4 4 // http://www.stevefenton.co.uk/Content/Jquery-Constant-Footer/ 5 5 // Feel free to use this jQuery Plugin 6 // Version: 3.0.3 6 // Version: 3.0.3 - modified by DC Team 7 7 // Contributions by: 8 8 9 var nextSetIdentifier = 0;10 9 var classModifier = ""; 11 10 12 var feedItems;13 var feedIndex;14 var feedDelay = 10;15 var feedTimer;16 17 function CycleFeedList(feedList, i) {18 feedItems = feedList;19 feedIndex = i;20 ShowNextFeedItem();21 }22 23 function ShowNextFeedItem() {24 //put that feed content on the screen!25 $("." + classModifier + " .content").fadeOut(1000, function () {26 $("." + classModifier + " .content").html(feedItems[feedIndex]).fadeIn(1000);27 PadDocument();28 feedIndex++;29 if (feedIndex >= feedItems.length) {30 feedIndex = 0;31 }32 feedTimer = window.setTimeout(ShowNextFeedItem, (feedDelay * 1000));33 });34 }35 36 // Gets rid of CDATA sections37 function StripCdataEnclosure(string) {38 if (string.indexOf("<![CDATA[") > -1) {39 string = string.replace("<![CDATA[", "").replace("]]>", "");40 }41 return string;42 }43 44 11 // Add padding to the bottom of the document so it can be scrolled past the footer 45 12 function PadDocument() { … … 52 19 var config = { 53 20 classmodifier: "constantfooter", 54 feed: "",55 feedlink: "Read more »",56 21 opacity: 0.8, 57 22 showclose: false, … … 77 42 $This = $(this); 78 43 79 // Add a div used for body padding80 // $This.before("<div id=\"" + config.classmodifier + "padding\"> </div>");81 82 44 // Hide it 83 45 $This.hide().addClass(classModifier).css({ position: "fixed", bottom: "0px", left: "0px", width: "100%" }) 84 85 // If there is a feed, we will replace the footer HTML with the feed86 if (config.feed.length > 0) {87 $This.html("");88 }89 46 90 47 // Show a close button if required … … 98 55 } 99 56 100 $This.append("<div class=\"content\"></div>");57 // $This.append("<div class=\"content\"></div>"); 101 58 102 59 // Show it … … 105 62 // Pad the bottom of the document 106 63 PadDocument(); 107 108 // Process any feeds109 if (config.feed.length > 0) {110 111 var feedList = new Array();112 113 $.get(config.feed, function(xmlDoc) {114 115 var itemList = xmlDoc.getElementsByTagName("item");116 117 for (var i = 1; i <= itemList.length; i++) {118 119 var title = xmlDoc.getElementsByTagName("title")[i].childNodes[0].nodeValue;120 var link = xmlDoc.getElementsByTagName("link")[i].childNodes[0].nodeValue;121 var description = xmlDoc.getElementsByTagName("description")[i].childNodes[0].nodeValue;122 123 var article = "<div class=\"item\">";124 125 if (link != null) {126 article += "<a href=\"" + link + "\">";127 }128 article += "<h2>" + title + "</h2>";129 if (link != null) {130 article += "</a>";131 }132 133 article += "<div class=\"description\"><p>" + description + "</p></div>";134 135 if (link != null) {136 article += "<div class=\"link\"><a href=\"" + link + "\">" + config.feedlink + "</a></div>";137 }138 139 article += "</div>";140 141 feedList[feedList.length] = article;142 }143 144 if (feedList.length > 0) {145 CycleFeedList(feedList, 0);146 }147 });148 }149 64 }); 150 65 };
Note: See TracChangeset
for help on using the changeset viewer.