Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8825657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:55:54+00:00 2026-06-14T06:55:54+00:00

I am building a mobile web app and I’m using jquerytools slider on it.

  • 0

I am building a mobile web app and I’m using jquerytools slider on it.

i want te slider to show (in proper ratio) across all mobile devices so width of the images is 100% and height is auto in css. However as all the elements are floated and jquerytools slider requires the position be set to absolute, the containing div (#header) doesn’t stretch to fit the content.

I am trying to use jquery to get the height of the height of the img and apply that height to the header…. however I am having no luck.

CSS:

    #header{
    width:100%;
    position:relative;
    z-index: 20;
    /* box-shadow: 0 0 10px white; */
    overflow: auto;
    }

.scrollable {
position:relative;
overflow:hidden;
width: 100%;
height: 100%;
/* box-shadow: 0 0 20px purple; */
/*  height:198px; */
z-index: 20;
overflow: auto;
}


.scrollable .items {
/* this cannot be too large */
width:1000%;
position:absolute;
clear:both;
/* box-shadow: 0 0 30px green; */

}

.items div {
float:left;
width:10%;
height:100%;

}

/* single scrollable item */
.scrollable img {
    /* float:left; */
    width:100%;
   height: auto;
 /*    height:198px; */
}

/* active item */
.scrollable .active {
    border:2px solid #000;
    position:relative;
    cursor:default;
}

HTML

<div id=header><!-- root element for scrollable -->
<div class="scrollable" id="scrollable">

  <!-- root element for the items -->
  <div class="items">


    <div>
      <img src="img/img2.jpg" />
    </div>


    <div>
       <img src="img/img1.jpg" />
    </div>


    <div>
     <img src="img/img3.jpg" />
    </div>

    <div>
     <img src="img/img4.jpg" />
    </div>

    <div>
     <img src="img/img6.jpg" />
    </div>

</div><!-- items -->

</div><!-- scrollable -->

</div><!-- header -->

UPDATED JQUERY

            <script>
        $(document).ready(function() {
        $("img.scrollable").each(function() {
            $('#header').css("height",$(this).innerHeight());
        });
        });
        </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:55:55+00:00Added an answer on June 14, 2026 at 6:55 am

    Checkout this jquery function: http://api.jquery.com/height/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a mobile web app using Sencha Touch 2, and I need
I'm building a web app using jquery mobile that will have lots of images
I'm building a web mobile app, using jQuery 1.1.1 and HTML5. I would like
I'm building a mobile web app targeting Android users. I need to know what
I'm building a mobile interface with JQuery Mobile for an already existing web app
I am in the process of building an mobile/web application. I want to use
I'm in the process of building a mobile web app, and I've run into
I'm going to be building my first mobile web app, and I found out
I am building a web app with jQuery Mobile. Almost every page of the
I am building a web app with jquery mobile. On one page I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.