I am currently running the following script in my layout:
jQuery(document).ready(function() {
$("#firstpane p.menu_head").click(function()
{
var img;
if
($(this).next("div.menu_body").is(':visible')) {
img = "url(highlight.png)";
} else {
img = "url(down.png)";
}
$(this).next("div.menu_body").slideToggle(600).siblings
("div.menu_body").slideUp("slow");
//$(this).siblings().css({backgroundImage:"url(left.png)"});
});
// Initialize jQuery keyboard navigation
$('.menu_head').keynav('keynav_focusbox','.menu_head');
// Set the first div as the one with focus, this is optional
$('.menu_head:first').addClass('keynav_focusbox');
$('.description').each(function(){
//...set the opacity to 0...
$(this).css('opacity', 0);
//..set width same as the image...
$(this).css('width', $(this).siblings('img').width());
//...get the parent (the wrapper) and set it's width
same as
the image width... '
$(this).parent().css('width',
$(this).siblings('img').width
());
//...set the display to block
$(this).css('display', 'block');
});
$('.wrapper').hover(function(){
//when mouse hover over the wrapper div
//get it's children elements with class description '
//and show it using fadeTo
$(this).children('.description').stop().fadeTo(500,
0.7);
},function(){
//when mouse out of the wrapper div
//use fadeTo to hide the div
$(this).children('.description').stop().fadeTo(500, 0);
});
$(".carousel").jCarouselLite({
auto: <?php if(count($sameCategory)<3){echo
0;}else{echo 1000;}?>,
speed: 1000,
hoverPause: true,
visible: <?php if(count($sameCategory)<3){echo count
($sameCategory);}else{echo 3;}?>
});
});
The problem area is the last function call jCarouselLite.
It works well for the movie/view controller but for other controllers
which does not set the $sameCategory variable it breaks all
javascripts.
How do i load this function call into jQuery(document).ready(function
() for just a specific view?
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=.