soopers Posted October 16, 2014 Share Posted October 16, 2014 Hello guys.I am using a revolution slider in my project, in which the background images of the slider are set using javascript code.So how can I set the path for that images because currently it is not displaying once I have convert the theme into yii. here is javascript code that I have paste in main layout file. jQuery(document).ready(function () { window.slider_bg = {"ind": 0, // index to start sliding at "source": ["<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide1.jpg", //replace these slides with your own ones "<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide2.jpg", "<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide3.jpg", "<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide4.jpg"], "bg_container": jQuery("#bg_container"), "bg_substrate": jQuery("#bg_substrate")}; window.slider_bg.bg_container.css("background-image", "url(" + window.slider_bg.source[window.slider_bg.ind] + ")"); }); the above code work fine on local server, but doesn't work on online server. How can I solve this ?Thanks in advance. Link to comment Share on other sites More sharing options...
Larry Posted October 20, 2014 Share Posted October 20, 2014 What's different about the online server from the local server? Are the URLs different? Are you seeing any error messages? Link to comment Share on other sites More sharing options...
Recommended Posts