soopers 0 Posted October 16, 2014 Report 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. Quote Link to post Share on other sites
Larry 428 Posted October 20, 2014 Report 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? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.