Can this slider is set to the entire document?

I want to implement on site change of image on the entire screen, but not on the entire document.
Found this vegas.jaysalvat.com but on a div to customize it does not work.
I am a fresh noob, could you tell me the tools to solve my problem ?
Or suggest what I'm doing wrong.

Need to replace #wrapper to the body and everything works.




<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<link rel="stylesheet" href="js/vegas/dist/vegas.min.css">
<script src="js/vegas/dist/vegas.min.js"></script>






<div id="wrapper"></div>


the <script>
 $(function() {
$('#wrapper').vegas({
 slides: [
 { src: 'photo/1.jpg' },
 { src: 'photo/3.jpg' },
 { src: 'photo/portret.jpg' }
]
});
});
</script>


June 10th 19 at 15:40
2 answers
June 10th 19 at 15:42
Solution
For what would this script was used for div, section, etc.
You need to do the following:

If the element ID

<div id="wrapper"></div>
$('#wrapper').vegas({
 slides: [
 { src: 'photo/1.jpg' },
 { src: 'photo/3.jpg' },
 { src: 'photo/portret.jpg' }
]
 });


If the item class
<div class="wrapper"></div>
$('.wrapper').vegas({
 slides: [
 { src: 'photo/1.jpg' },
 { src: 'photo/3.jpg' },
 { src: 'photo/portret.jpg' }
]
 });
Does not work, unfortunately.
But errors does not produce. - vernie92 commented on June 10th 19 at 15:45
the altitude of diva set?
Try using a variable
var wrapper = $('#wrapper');

wrapper.vegas ({...}); - Austyn.Kunze72 commented on June 10th 19 at 15:48
specify the height of the diva to which to apply the height for example height:500px; and see - Verda.Labadie commented on June 10th 19 at 15:51
, , Set the height and width helped. Thank you so much!
I tried to interest ask earlier, but it didn't work for some reason.
Don't know why ? - vernie92 commented on June 10th 19 at 15:54
Height is something in percent. Set
body, html{ 
height:100%;
}
- Verda.Labadie commented on June 10th 19 at 15:57
Edinstvenny response "it is not how to take height", read about height 100% article. If you want that block was always the window size, then the answer above.

Other options
...in using the measurement units vw vh, BUT does not support Safari, so it is better through jquery to take the value $(window).width and $(window).height and not to forget to override them in resize window $(window).resize (...); - Austyn.Kunze72 commented on June 10th 19 at 16:00
and generally googling about that (vh, vw, vmin, vmax) - Verda.Labadie commented on June 10th 19 at 16:03
June 10th 19 at 15:44
Make sure of the correct spelling of all of the tags in your above example is missing parentheses. Then plug this script in the end of the page, before the closing tag /body. If you can't produce any errors, so at the time of calling the script, the script does not know about the existence of div.
Corrected.
In the code everything is correct, at least such stocks are not observed.
Tried to connect

Here is the entire code
You should replace #wrapper into the body and voila




<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<link rel="stylesheet" href="js/vegas/dist/vegas.min.css">
<script src="js/vegas/dist/vegas.min.js"></script>






<div id="wrapper"></div>


the <script>
 $(function() {
$('#wrapper').vegas({
 slides: [
 { src: 'photo/1.jpg' },
 { src: 'photo/3.jpg' },
 { src: 'photo/portret.jpg' }
]
});
});
</script>


- vernie92 commented on June 10th 19 at 15:47
helped define the width and height, I tried to interest previously, but required a static value to set, type px. - Austyn.Kunze72 commented on June 10th 19 at 15:50

Find more questions by tags JavaScriptjQueryWeb Development