Jump to content

Recommended Posts

Posted

hi!

i have a field called bgimage and set it to hold 1 image, & assigned  to all of my site templates, with diferent images for each page, i want to use Vegas slideshow as background in my pages using a  bgimage, as src

$.vegas('slideshow', {
    backgrounds:[
      { src:'images/background-1.jpg', fade:2000},
      { src:'images/background-2.jpg', fade:2000}
    ]
  })('overlay', {
    src:'assets/img/overlay.png'
  }); 

how can i make bgimage field output in the code above

thank you.

Posted

Replace:

src:'assets/img/overlay.png'

with:

src:<?php echo $page->bgimage->url;?>

or I'm wrong? - It is output into JS.

  • Like 1
Posted

thank you friends! this works fine

<script>  
  $.vegas('slideshow', {
    backgrounds:[
      { src:'<?php echo $page->bgimage->url;?>', fade:2000}
    ]
  });  
  </script> 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...