[ 2 posts ]

rasyog

  • Username: rasyog
  • Joined: Wed May 11, 2011 3:26 pm
  • Posts: 3
  • IRC: rasyog
  • Offline
  • Profile

YUI 2.9.0 - Carousel Navigation buttons

Post Posted: Tue May 17, 2011 7:34 am
+0-
Hi,

I added a button on carousel navigation bar (YUI 2.9.0). That button is not visible in any other browser but Chrome. I even tried to wrap a span that includes button in to an outer DIV but no luck!!!

Appreciate any help I get to resolve this problem.

Here is a piece of code:

function init_carousel()
{
var carousel = new YAHOO.widget.Carousel("carouselcontainer");
carousel.set("numVisible", 1);
carousel.set("animation", { speed: 0.01 });
carousel.set("autoPlayInterval", 2000);
carousel.set("isCircular", true);
carousel.render();
carousel.show();
carousel.startAutoPlay();
}
YAHOO.util.Event.onDOMReady(init_carousel);
YAHOO.util.Event.onContentReady("carouselcontainer", function() {

var carNavs = carouselcontainer.getElementsByClassName('yui-carousel-nav');
var carNav = carNavs[0];
var commentButton = document.createElement('span');
commentButton.className = 'yui-carousel-button yui-carousel-comment-button';
commentButton.innerHTML = '<button name="Comment" type="button">Comment</button>';
commentButton.style.cssFloat = 'left';
commentButton.addEventListener('click', Oncomment, false);
carNav.appendChild(commentButton);
});

jack k

  • Username: YUI_Hater
  • Joined: Fri May 27, 2011 8:58 am
  • Posts: 1
  • Offline
  • Profile

Re: YUI 2.9.0 - Carousel Navigation buttons

Post Posted: Fri May 27, 2011 9:30 am
+0-
Have you tried adding the markup for the button to the HTML source of your document, and targeting it that way, instead of appending it in JavaScript? What does firebug show for the styles in Firefox? It might help if you provided the HTML structure of your carousel from your document, as well. it's hard to debug without being able to see all the pieces.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum