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 1016621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:34:35+00:00 2026-05-16T10:34:35+00:00

I have an HTML page. I have created a frame using background repeat function.

  • 0

I have an HTML page. I have created a frame using background repeat function. It is like a dialog box as below :

alt text

The HTML Code for this is :

<html>
<head>
<title>
Frame
</title>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="frame.js"></script>
<link rel="stylesheet" href="frame.css" type="text/css" media="screen" />
</script>
</head>
<body>
<div id="frame">
    <div id="h" style="width:400px" class="h">Frame</div>
    <div id="l" style="height:400px" class="l"></div>
    <div id="r" class="r"></div>
    <div id="b" class="b"></div>
</div>
</div>
</body>
</html>

The jQuery is :

$(document).ready(function() {

        var width = $('#h').width();
        var height = $('#l').height();
        var pad = $('#h').position().left;
        var actWidth = width + pad;
        var nHeight = height - (height * 2);
        var rLeftMargin = actWidth + 1;
        var bWidth = actWidth + 2;

        $('#r').css({'margin-top':nHeight});
        $('#h').css({'height':25});
        $('#r').css({'margin-left':rLeftMargin});
        $('#r').css({'height':height});
        $('#b').css({'width':bWidth});
        $('#b').css({'margin-top':0});
    }
)

And the CSS is :

.h{
background-image:url('images//line.jpg');
background-repeat: repeat-x;
padding-left:10px; 
color:white;
}
.l{
background-image:url('images//dot.jpg'); 
background-repeat: repeat-y; 
}
.r{
background-image:url('images//dot.jpg'); 
background-repeat: repeat-y; 
float:top;
}
.b{
background-image:url('images//dot.jpg'); 
background-repeat: repeat-x; 
height:1px;
}

Now, the problem is, this frame I can only use once. If I use is once again, then Ids get repeted & all the frame gets affected !!! This should not happen. What can be the solution?

  • 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-05-16T10:34:35+00:00Added an answer on May 16, 2026 at 10:34 am

    Instead of using IDs, use the classes you already have and just look over each frame independently, like this:

    $(function() {
      $(".frame").each(function() {
         var width = $(this).find('.h').width(),
             height = $(this).find('.l').height(),
             pad = $(this).find('.h').position().left,
             actWidth = width + pad,
             nHeight = height - (height * 2),
             rLeftMargin = actWidth + 1,
             bWidth = actWidth + 2;
    
        $(this).find('.r').css({'margin-top':nHeight, 'margin-left':rLeftMargin, 'height':height});
        $(this).find('.h').css({'height':25});
        $(this).find('.b').css({'width':bWidth, 'margin-top':0});
      });
    });
    

    Just remove all IDs and change the wrapper to <div class="frame"> to make this work. By .each() to loop through each frame and using tree traversal methods like .find() you can get the elements with the matching classes inside the particular <div> you’re currently on in the loop.

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

Sidebar

Ask A Question

Stats

  • Questions 538k
  • Answers 538k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In your case as list is an ArrayList<Object>, T is… May 17, 2026 at 1:55 am
  • Editorial Team
    Editorial Team added an answer I'm looking at these types in Reflector and all of… May 17, 2026 at 1:55 am
  • Editorial Team
    Editorial Team added an answer SeckeychainItemref is not available in the iOS SDK. As far… May 17, 2026 at 1:55 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have split up my HTML page using div blocks. Within one of the
I have to do an HTML page with 2 text boxes, one for name
I have a FireWorks-generated HTML page and I added some jQuery to it for
I'd like to enforce a requirement that client script inside a page (which in
I'm currently creating a very small form on my homepage using HTML and JavaScript.
On a page, something like jsFiddle, that executes user inputed Javascript, is there a
I have a simple XML file created in R that consists of the following
I'm using the Fish Gadget ( http://abowman.com/google-modules/fish/ ) within a wiki based CMS, and
I have a Google calendar embedded on a webpage, with events related to activities
How does images.google.com render its frames?? I have two servers, that have external web

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.