Jquery vegas plugin image resize within div elements

0 votes

I am using the jquery vegas plugin that re sizes the background images, yet I would like to learn how to resize the images contained within selected elements.

Example:

  • HTML <div class="bg1"></div>
  • CSS .bg1 {background-image: url(../img/bg1.jpg);}

What would be the java function to make the image scale to 100% width of the div bg1, bg2, etc. and have the overlay pattern enabled too.

Thanks for any help.

Regs Fab

Aug 4 in Web Development by gaurav
• 22,040 points
53 views

1 answer to this question.

0 votes

Actually vegas plugin is meant for body backgrounds. It should work for $(".bg1") or any other element but its not working.

Explanation form jay salvat :

Original $.vegas doesn't work anymore. $.vegas must apply the plugin on the body by default while $('tag').vegas must apply it to the specific tag. Also, If I apply vegas to several tags, only the last one works. Multi-instance should be possible. It would be great if you could find time to fix those issue !

answered Aug 4 by rajatha
• 7,480 points

Related Questions In Web Development

0 votes
1 answer

How to hide a div with jQuery?

We hide the divs by adding a CSS ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,480 points
51 views
0 votes
0 answers

How to add a link in Jquery PrettyPhoto to download the image

I am using Jquery PrettyPhoto to have ...READ MORE

Jun 29 in Web Development by gaurav
• 22,040 points
96 views
0 votes
1 answer

How to change an element's title attribute using jQuery

You can change the title attribute with ...READ MORE

answered Jun 30 in Web Development by rajatha
• 7,480 points
537 views
0 votes
0 answers

scroll up and down a div on button click using jquery

I am trying to add a feature ...READ MORE

Jun 29 in Web Development by gaurav
• 22,040 points
2,661 views
0 votes
1 answer

How to use jquery with asp.net ajax?

If you weren't aware, Microsoft is planning ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
235 views
0 votes
1 answer

Is 'sparkline' a method?

I suggest you to check 2 things That jquery.sparkline.js is actually ...READ MORE

answered Nov 9, 2018 in Apache Spark by Frankie
• 9,830 points
659 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,510 points
401 views
0 votes
1 answer

Error: Global Variable is not accessable to local function

Hey kartik, A variable declared outside a function has a ...READ MORE

answered Feb 19, 2020 in PHP by Niroj
• 82,800 points
332 views
0 votes
1 answer

How to place images using jQuery masonry plugin to start

You were just missing a css class that adjusts ...READ MORE

answered Jun 22 in Web Development by rajatha
• 7,480 points
73 views
0 votes
1 answer

Smooth scroll to div id jQuery

You need to animate the html, body $("#button").click(function() { ...READ MORE

answered Jun 23 in Web Development by rajatha
• 7,480 points
387 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP