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
758 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,680 points

Related Questions In Web Development

0 votes
0 answers

How can I select only visible elements within a specific section of my page using jQuery selectors?

How can I select only visible elements ...READ MORE

6 days ago in Web Development by Nidhi
• 4,220 points
24 views
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,680 points
440 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
930 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,680 points
4,715 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
764 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,302 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,520 points
1,349 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,840 points
1,106 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,680 points
572 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,680 points
3,277 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