JQuery :: Using Scale On An Absolutely Positioned Div?
Aug 20, 2010
I have a Div element (id=Div1) that is absolutely positioned on the page. Inside it I have another Div (id=Div2) that is absolutely sized so that it fills the whole of Dvi1.Looking at the UI/Effects/Scale page in the API docs I see the example code:
Translating this I am trying to make Div2 shrink until it vanishes, as shown in the example, so I am using $("#Div2") to get this done, however, it does not work.Is this because the Div (either of them!) is absolutely positioned? Ideally Id like Div2 to shrink away to nothing on the click of a button, but first steps first.
I am having a problem with an absolutely-positioned div disappearing while IE7 is animating. The animation has a z-index lower than the div containing Questions, Customizable, and Library, but the div disappears during animation. Is there anything I can do about this? I've tried changing the positioning, z-index, and moving the div to occur before the animation, but nothing seems to work. Everything looks fine in FF, IE8, and Safari.
I have about 40 divs, all positioned absolutely with a certain width and a left attribute.I am looking for a way to make sure all these divs don't overlap, meaning that if one div has its starting point (left) within another div(left+width), the first div should be moved down as long as it takes (height of 2nd div).Having barely any experience with jQuery at all, I really hope I can find some answers here.
Anyone know of a method to lazy load images which are absolutely positioned on top of each other? I have seen the lazy load plugins out there, but none of them seem to work with this layout. I am using jQuery cycle to animate a slideshow. Cycle takes the slides and absolutely positions them on top of one another. Any way to lazy load these? I'm sure I could do it custom but pulling all of the slides not currently active and load them later, but I am looking for an easier way.
I've designed a web page that uses several DIVs that use absolute positioning so they can layer on top of each other with transparent shadows. You can view the design here:http:[url]...The client wanted the whole design to center in the window horizontally, and since I can't use margin: 0 auto; to achieve this, I'm using a script that detects the window size using the onLoad operator in the body tag. This is the script:
Code: <!-- window.onresize= alertSize; function alertSize() {[code].....
It works, but I don't like that the page snaps back to the left every time a new page loads. Is there a way for the script to detect the window size from the previous page so that the design won't jump if the window hasn't been resized?
how can I put an element below another element, that's not absolutely positioned? so I have a n element, called X, and next to that, an element Y
X Y
XXXXXX XXXXXX XXXXXX
YYYYY YYYYY YYYYY
these elements are both visible: when i click on X, i want to add to the page a new element X1, that's below X, but on top of Y
XXXXXX XXXXXX XXXXXX
Y X1X1X1 Y X1X1X1 Y X1X1X1 YYYYY YYYYY
this I can do easily with position:absolute, however, due to the flow layout I'm currently using (and can't really change), I can't.
one way of solving the problem, could be to determine an absolutely positioned element's X and Y coords, (and width and height) while i doubt this can be done in a cross browser way (or at all), when teh suer resizes the window, I'll be ni trouble (which will mean I have to add onresize handlers, which, i dont really like....)
another way, would be playing with CSS properties, like float, position:relative, overflow, etc. but I don't know that much CSS to even try.
another way would be using the DOM to append an item, using InsertBefore, or something like that, but it appears that won't solve the problem of putting the new insetred element X1 above Y.
what I'm trying to achieve, is something like the <selecttag, that pops iots information above the elements next to it.
I'm converting a flash site [URL] to HTML, and I'm using the force of jquery for the animations.If you go to the site above and click "The Course" tab you'll see a scale toggle with the thumbnails. I want to know how to do that solidly.
A) I tried all day yesterday to do it with this function:
I have problem with using very smooth jquery animate. I need to zoomIn Images with effect depth and walking into image. When i'm using css3 with animation and scale everythink looks like ok, the animation is very smooth but when i using css2 with jQuery animate thats look not good,
Is it absolutely necessary to put the JavaScript code in the HEAD? I have a lot of JavaScript code in the BODY and they all appears to be working just fine. What is the downside of putting JavaScript code in the BODY? What can go wrong?
Sometimes you can not avoid putting JavaScript code in the BODY. Like for instance, when you provide your members with a HTML code for a poll and the code has JavaScript in it.
I'm having an issue with looping a set of divs that are positioned on top of each other. When a link is clicked, the second div should fade in as the top div fades out, which coincides with another div changing background colour.As you'll notice, when the link is clicked for a third time, it loops back to the beginning by using the rel tag to keep track of what div is showing. The problem is that when it loops to the beginning the animation is not in sync with the second div changing colour.The code for all three is exactly the same and it doesn't matter how many coloured divs you have, it's always the last one fading out that causes the issue. The '#second' colour change fires after the box changes, not synchronised like the previous clicks.This is a basic example that I'm using on a site elsewhere so the concept of the second div fading in and then the first fading out is important - I can't switch so the first fades out then the second fades in.
I have a routine that centers an object. I pass it a string such as "#myid" and it sets the 'left' property based on the width of the object and of the monitor.
Now in theory I could just use <center> tags, but I'm trying to center an object that is positioned using the 'absolute' attribute. It seems that <center> tags have no effect on 'absolute' positioned objects.
(I need the 'absolute' because the screensscroll underneath it). Anyway, I've been told that this is bad practice, and positioning should always be done via css, and never jquery/javascript. But I don't see any other way to do this. Is there one?
For one project i am suing jdMenu to power up the drop down menu system. I am interested for the second level of the menu to position the <ul> at 50% on the parent <li>, like on[URL]...
Using css this is not possible since the ul has the size in em and the parent li have the size in %. So have to use a different method...
i am trying to learn how to position a show/hide module to the "a" that triggers it, instead of a literal positioning through css this is a sample of the module i am trying to position.[URL]..would like to set the object relative to the cell where the trigger exists. can anyone point me in the direction of tutorials or samples of this behavior?
How to determine how a absoluted positioned element was positioned?
For example, a div positioned with bottom: 10px, will have a "top" read in Firefox. But if using "top" to move the box, instead of moving it, it will grow or shrink.
Provided an interface to a search engine in which the onchange event in a select list element generates between 7 and 13 additional elements depending on the option chosen.
Here's what the customer *now* wants to do: Generate between 200 and 350 elements. Furthermore, the logic is going to be more complex.
I would be happy to make that happen, however here's my concern: I'm already doing this from the server side, using CGI. I wonder what is going to happen when we put that degree of "work" on the client browser. I would welcome comments, caveats, or pointers to documentation and discussions on this subject.
I've been trying to show a div using jQuery's show function with the scale effect. My code works fine in Firefox. When I test it in IE7, it breaks. I narrowed it down to either the origin argument of the scale effect, or the time argument of the show function (which seems unlikely). Like this:
Works in IE7, italics added to show commented code better:
I have img element with max-height: 450px; max-width: 800px i load image in that img element that image width 1,024px and height 786px now i want get that image width after escalation i use that javascript code ...
its work fine in IE and its give me 586px but in Firefox it still give me 1,024px the original width before escalation.
My javascript canvas width and height are both 960. I have found that my screen horizontal and vertical resolutions are both 96 dpi. Thus, when a drawing is rendered in the full width and height of the canvas, it should be measurable by a ruler to be physically 10 inches by 10 inches. I did measure the display on the screen and found it to be actually about 11 and 3/16 inches wide. What is the proper way to scale a canvas so that the resulting physical dimensions can be calculated more precisely?
I have an div element (lets call it div number 1) that I have attached a click event to using jquery.bind() method. That works fine. I then have another div element (div number 2) that is absolute positioned on top of div 1. Now div number 2 also has a click event binded to it, which works... the problem is when I click div 2 and the click event triggers, so does the click event from div 1... I don't want the click event from div 1 to fire.
I have some fixed or absolute positioned DOM elements in the whole document for some purpose, How can I traverse the whole document to get the above mentioned elements, any jquery method to be there please let me know,
Internet Explorer can't bind events to absolute positioned elements ? can't bind a "click" to an element that is overlapping another.Have tried loads of different ways, here are 5 of them:
version 1: $(".classHolder").click(function(){ alert( $(this).html() ); }); version 2:
I have a client that wants to add images to her website,.I need a script that can scale an image and keep it portrait/landscape, but inside a 120x120 box.As far as I know (from my limited knowledge) it would go something like
if height > width then height = 120px else width = 120px
I've wondering if anyone knows of a script where I can scroll a div down the page as the user scrolls down the page. You know, like those annoying ads do sometimes
I've googled for some, but the ones I've tried only work to varying degrees when I want the div positioned relatively. The reason I want it relatively positioned is that my site is centred, and fixed-width.
Basically, I need it to scroll up and down in a 'side bar' area, and the main problem I seem to be having: not scroll below my footer area.
I have an absolute positioned navigation on my page that makes you jumps up or down the page to view some pictures placed in another absolute positioned DIV with scroll bar. The navigation is simply made by numbers: 1 2 3 4 5 6. When you rollover 2 is underlined and onclick the page jumps down to the second picture and the number 2 stays underlined, and so on for 3 4 5 6. The style changes this way
HTML <span id='first' class="selected"><a href="#1" onclick="first()">1 </a></span> <span id='secondo' class="normal"> <a href="#2" onclick="second()">2 </a></span> and so on for 3 4 5 6
[Code]....
What I would like to do is to make the style change automatically also when the user scroll the page instead of clicking. I thought I could control the y coordinate with window.onscroll but because what scrolls is the DIV and not the page the window.onscroll doesn't work. Is there a way to control the same way the scroll of a DIV? Or should I build the site differently?
I am looking for a image gallery that will work where some photos are positioned horizontally and some are vertical. I hope it is possible. The photos are for an artist that I am working with. I hope someone will have an answer. It doesn't have to be fancy. Even a simple magnifyer would be fine. I guessed that javascript might be the most appropriate form.
I can't get the form validation and the postioned layers/radio buttons working at the same time is either 1 of the other. I have provided the code html/css/javascript code below [URL]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>