0

Wait moment this question not duplicated..it is sample and difficult at the same time.

This simple problem make me crazy..

http://www.mediafire.com/?2vi2kc7tpqiw1to

This is slide code contain CSS, HTML, jQuery code.

This slide works fine, but when I include this slide in cakephp it is not working.

I put jQuery files and CSS in webroot and put the code to include in layout/default.ctp like this

echo $javascript->link('jcookie.js');
echo $javascript->link('jquery-1.3.2.min.js');
echo $javascript->link('jcarousellite.js');
echo $javascript->link('jquery-1.js');

but still nothing happen ..please anyone help me..download the slide and try to click on the top to slideshow pictures..and then include it in cake..you will find the problem..

3
  • 1
    You can try passing an array into $javascript->link instead, like $javascript->link(array('jcookie.js', 'jquery-1.3.2.min.js', 'jcarousellite.js', 'jquery-1.js')); - not sure how that will help, but I suppose it's better than nothing. Commented Nov 19, 2011 at 6:06
  • i tried this sulution john but slide not work..thank you Commented Nov 19, 2011 at 15:17
  • please tag ur questions correctly. this not a cakephp 2.0 question Commented Nov 26, 2011 at 19:29

2 Answers 2

1

a) you shouldnt use $javascript anymore. it would be $this->Javascript

b) javascript itself is deprecated (see the documentation)

so use

$this->Html->script()

details: http://book.cakephp.org/view/1589/script

Sign up to request clarification or add additional context in comments.

1 Comment

thank you mark..i tried all ways and your suggestion but the slide not work also
0

This is what I did to get e Jquery Slider working on a Cake generated page default.ctp:

I dropped my js files in webroot/js/libs and css files in webroot/css - NOTE: That the .js and .css extensions are left off.

<?php
 echo $this->Html->css('royalslider', null, array('inline' => true));
 echo $this->Html->css('royalslider-skins/default/default', null, array('inline' => true);
 echo $this->Javascript->link('libs/jquery-1.6.2.min', true);
 echo $this->Javascript->link('libs/jquery.easing.1.3.min', true);
 echo $this->Javascript->link('libs/royal-slider-7.9.min', true);
 echo $scripts_for_layout;
endif;
?>

I put the slider HTML somewhere in the body

I put the Slider Javascript: script type="text/javascript" right before the closing /body tag..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.