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, 2022 in Web Development by gaurav
• 23,260 points
446 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, 2022 by rajatha
• 7,640 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, 2022 in Web Development by rajatha
• 7,640 points
269 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, 2022 in Web Development by gaurav
• 23,260 points
648 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, 2022 in Web Development by rajatha
• 7,640 points
3,669 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, 2022 in Web Development by gaurav
• 23,260 points
7,307 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
538 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
1,012 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
1,004 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,880 points
854 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, 2022 in Web Development by rajatha
• 7,640 points
372 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, 2022 in Web Development by rajatha
• 7,640 points
2,692 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