How to stretch a GIF to fill the whole div using jQuery Mobile

0 votes

I'm using jQuery Mobile to create a small app. I have a GIF which is displayed. It works fine on iPhone 4, but when I go to iPhone 5 or Windows Phone, I get a blank space at the bottom for iPhone 5, and I get a blank space for both buttom and right sides in Windows Phone. So, whatever the size of the device, I want the GIF to stretch and fill the whole div. I already searched through and tried some answers from similar questions, but no luck, maybe because they don't use jQuery Mobile, or because they use older version of CSS. Anyway, below you can find my HTML.

<div id="correctGIF" data-role="page" data-add-back-btn="false">
    <img src="images/Correct1.gif" class="cor">
</div>

I tried this CSS, but no luck:

#correctGIF {
    width: 100%;
    height: 100%;
    position: fixed;
    left: 0px;
    top: 0px;
    z-index: -1;
}

.cor {
    width: 100%;
    height: 100%;
}

Aug 22 in Web Development by gaurav
• 18,960 points
22 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
0 answers

How to get the value of a checkbox flipswitch in JQuery Mobile 1.4.5?

I'm using following markup to create a ...READ MORE

Aug 22 in Web Development by gaurav
• 18,960 points
25 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 in Web Development by rajatha
• 7,440 points
34 views
0 votes
1 answer

How to create a simple map using JavaScript/JQuery

var map = new Object(); // or ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,440 points
49 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
• 18,960 points
45 views
0 votes
0 answers
0 votes
0 answers

how to convert a decimal number to fraction using jquery

I want to convert the decimal number ...READ MORE

Jul 28 in Web Development by gaurav
• 18,960 points
34 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
328 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,780 points
298 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,780 points
9,339 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,780 points
16,534 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP