Answer the question
In order to leave comments, you need to log in
How to set path to css file in js?
Hello everybody! The problem is the following, I did the layout and used the layerslider carousel, everything worked fine in the layout, I transferred the template to yiI2, connected all the scripts and styles, and the carousel stopped displaying, my suspicion falls on the skinsPath parameter, which specifies the path to the file with styles for the carousel to work. The question is how to correctly specify the path to the file with styles?
$('#layerslider').layerSlider({
autoStart: true,
responsive:true,
responsiveUnder: 1280,
layersContainer: 1280,
hoverPrevNext: false,
skin: 'fullwidth',
skinsPath: '/css/skins/',
showCircleTimer: false,
hideOnMobile: false,
navStartStop: false,
navButtons: false
});
Answer the question
In order to leave comments, you need to log in
Good evening.
Why not use AssetBandle? Connect all styles and js in it humanly and not suffer.
Although you can also use this option:
<?php
$url = Url::toRoute('path_to_css');
$thsi->registerJs("
$('#layerslider').layerSlider({
autoStart: true,
responsive:true,
responsiveUnder: 1280,
layersContainer: 1280,
hoverPrevNext: false,
skin: 'fullwidth',
skinsPath: '" . $url . "',
showCircleTimer: false,
hideOnMobile: false,
navStartStop: false,
navButtons: false
});
", View::POS_END);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question