* */ // Get the image link from within its (parent) container. getAttribute:function(parent,attribute) { var el = parent.firstChild; while (el) { // walk through till as long as there's an element if (el.nodeName.toUpperCase() == "DIV"){ el = el.firstChild; if (el.nodeName.toUpperCase() == 'SPAN') { el= el.nextSibling; } } if (el.nodeName.toUpperCase() == "IMG") { return el.getAttribute(attribute); } el = el.nextSibling; } return ""; }, carousel: {}, init:function(ev){ var spotPag = YAHOO.util.Dom.get("spotPag"), spotTitle = YAHOO.util.Dom.get("spotTitle"), spotImage = YAHOO.util.Dom.get("spotImage"), spotCaption = YAHOO.util.Dom.get("spotCaption"), spotUpdate = YAHOO.util.Dom.get("spotUpdate"), caption = YAHOO.util.Dom.get("caption"),copyright = YAHOO.util.Dom.get("copyright"), carousel = new YAHOO.widget.Carousel("container", { numVisible: 5, navigation: { prev : 'hl-edit-nav-back', next : 'hl-edit-nav-forward'} }); carousel.registerPagination('{firstVisible} - {lastVisible} of {numItems}'); carousel.on("itemSelected", function (index) { // item has the reference to the Carousel's item var item = carousel.getElementForItem(index); if (item) { spotPag.innerHTML = '' slides.getAttribute(item,"page") ''; spotTitle.innerHTML = slides.getAttribute(item,"title"); if (slides.getAttribute(item,"collectionName")=="ArticleItems" || slides.getAttribute(item,"collectionName")=="RodaleSlideshow" ) { spotImage.innerHTML = ''; } else { spotImage.innerHTML = ''; } spotCaption.innerHTML = '' slides.getAttribute(item,"caption") ''; spotUpdate.innerHTML = '' slides.getAttribute(item,"copyright") '' slides.getAttribute(item,"attribution") ''; } location.hash = '#' index; }); carousel.render(); // get ready for rendering the widget carousel.show(); // display the widget slides.carousel = carousel; /* check for param.id (articleImage). We need to pre-select the id'd image*/ //alert(slides.defaultSelectedIndex); carousel.set('selectedItem',slides.defaultSelectedIndex); onHashChange(function(index) { index = parseInt(index); if (typeof index == 'number') { carousel.set('selectedItem', index); refreshAds(index); } }); } }/* close slides */ YAHOO.util.Event.onDOMReady(init); var toggleBox = { collapsedText: "Show Thumbnails", expandedText: "Hide Thumbnails", flip: function(containerId, linkId) { var containerRef = document.getElementById(containerId); var linkRef = document.getElementById(linkId); var isClosed = (containerRef.style.display != 'block' && containerRef.style.display != '' ) ? true : false; if (isClosed) { linkRef.innerHTML = this.expandedText; containerRef.style.display = "block"; } else { linkRef.innerHTML = this.collapsedText; containerRef.style.display = "none"; } } }
1 - 5 of 12
Gwyneth Paltrow's Arm and Abs Workout
via health.yahoo.net
No comments:
Post a Comment