jquery - Full responsive background image -


i try understand how can full background image responsive. @ first using jquery anystretch.

the code.

functions.php

wp_register_script( 'jquery.anystretch', get_template_directory_uri() .'/js/jquery.anystretch.js', array( 'jquery')); wp_enqueue_script( 'jquery.anystretch'); 

main.css

.imgheader { background: url("images/image.png")  height:450px; width:100%; background-repeat: no-repeat; background-size: cover; overflow: hidden; position: relative} 

index.php

<figure class="container imgheader"> </figure> 

header.php

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> <?php wp_enqueue_script('jquery'); ?>  <script type="text/javascript"> jquery(document).ready(function($) { (function()  { $('.imgheader').anystretch("images/image.png"); }) }); </script> 

also, try :

   $('figure.imgheader').anystretch("images/image.png"); 

from documentation :

<script type="text/javascript"> jquery(document).ready(function($) {   $('.imgheader').anystretch("images/image.png", {speed: 150}); }); </script> 

3rd edit:

<script type="text/javascript"> jquery(document).ready(function($) {   $('figure.imgheader').anystretch("images/image.png", {speed: 150}); }); </script> 

4th update: problem same jquery-backstretch. loading plugin full background image , image inside container, , didn't work. of firebugs see js loading in page. see again couple of hours , back.

but problem same, script not load. doing wrong?

thanks in advanced.

i'm not sure what's happening here, if don't working can advice use of jquery backstretch. have used myself couple of times in projects , gets job done.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -