13

Create a margin with jQuery to position the element under the absolutely positio...

 3 years ago
source link: https://www.codesd.com/item/create-a-margin-with-jquery-to-position-the-element-under-the-absolutely-positioned-element.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Create a margin with jQuery to position the element under the absolutely positioned element

advertisements

Is it possible to position the bottom element #fooBar 40px below the ul#bar that will have a varying number of li's. I don't want to have to create a class for each element of #fooBar with the appropriate margin. Please see this pic http://yfrog.com/9gstructurewp

basically I want to take the height of ul#bar, then add 80px to that number and make that #fooBar's top margin. thanks


This won't work?

$('#fooBar').css('margin-top', $('ul#bar').height() + 80);

Tags jquery

Related Articles

Creating a list with entries requested by the user?

I'm a beginner and taking an intro Python course. The first part of my lab assignment asks me to create a list with numbers entered by the user. I'm a little confused. I read some other posts here that suggest using "a = [int(x) for x in input().spli

What is the best way to test an empty string with jquery-out-of-the-box?

What is the best way to test for an empty string with jquery-out-of-the-box, i.e. without plugins? I tried this. But it did't work at least out-of-the-box. It would be nice to use something that's builtin. I wouldn't like to repeat if (a == null || a

Sanitize a Variable & amp; to integrate the PHP code with Jquery Validation for the form

I have a piece of code for checking if a "user already exists" in my database and i was told that the code is outdated as get_magic_quotes_gpc no longer works and my username variable is not sanitized . I tried to update the code but not sure if

Creating a range with a fixed number of elements (length)

In Python 2.7, how can I create a list over a range with a fixed number of elements, rather than a fixed step between each element? >>> # Creating a range with a fixed step between elements is easy: >>> range(0, 10, 2) [0, 2, 4, 6, 8] &g

Creating check boxes with jQuery - odd behavior of IE

I'm creating some checkbox elements on the fly with jQuery and appending them to a node like so var topics = ['All','Cat1','Cat2']; var topicContainer = $('ul#someElementId'); $.each( topics, function( iteration, item ) { topicContainer.append( $(doc

Replace / reload the input list with jQuery and leave the first element

I created jQuery function that gets bunch of simple objects that contains id and title. Then I run simple loop to create list: $.each(data['results'], function(key, val) { items.push('<label for="radio_show_' + val['id'] + '" >' + '<inp

How to create a div with jQuery

Morning :) Im trying to create a div everytime a push one button with jQuery. $('#button_submit').click(function() { //create a div inside a already existing div (<div id="save"></div>) with this parametres: /* <h3>Title</h3

Creating Button Flyovers with jQuery

I'm trying to make a function that I can use globally to create rollover states for images. Basically, I want to be able to add a class to an image, and then when you rollover it, jquery will use the same image name, and same extension, but add "-ove

Create a cookie with jquery

Possible Duplicate: How to set/unset cookie with jQuery? How would I go about creating a cookie using jquery to save a number of form fields on a website, also is it possible to save a cookie without using a save function, but instead when the each t

Creating complex HTML with jquery

Im having trouble creating complex html with javascript or, preferably, jQuery. My goal is to create this: <div class="clone"> <div class="nested_clone> <span> </span> </div> </div> purely with jquery and

I want to create a publication with a preview of the website

I want to create a post with web site preview. It must be similar as on screenshot. How do I create a post with web preview? I want to add it on pages. NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@"Post with web preview", @&q

Creating a UITableView with Taller Cells on the iPhone

How can I go about creating a UITableView with taller cells? Basically, I want to create a full screen table with only four cells, but they should take up the entire screen (1/4 each). Assuming this is possible using a UITableView, can it be done bot

Create a form with javascript and pass the variable to the function

Ho can I can I create a textbox with javascript and then onclick, pass a function with argument? below the commented out line is the problem var inputBox = document.createElement("input"); inputBox.staff = project.staff[j].name; inputBox.default

Twig syntax error when creating a form with {{form_widget (form)}} in the Silex micro-framework (symfony-forms)

I am playing with Silex microframework. First I have installed Twig extensions for Twig with composer: composer require twig/extensions I added this configuration to my front controller (index.php): // CONFIG // turn on debug in Silex microframework

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK