Search Results

Search found 8467 results on 339 pages for 'alternate elements'.

Page 63/339 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • How can I animate multiple elements sequentially using jQuery?

    - by lorenzium
    I thought it would be simple but I still can't get it to work. By clicking one button, I want several animations to happen - one after the other - but now all the animations are happening at once. Here's my code - can someone please tell me where I'm going wrong?: $(".button").click(function(){ $("#header").animate({top: "-50"}, "slow") $("#something").animate({height: "hide"}, "slow") $("ul#menu").animate({top: "20", left: "0"}, "slow") $(".trigger").animate({height: "show", top: "110", left: "0"}, "slow"); });

    Read the article

  • Cannot select elements with jquery after a html() load in Internet Explorer 8. Mozilla works fine...

    - by user641379
    I have the following code that runs in a display:none; divtab1 function ToggleTab(tab_id) { $('.divtab1').html('<div class="promo2">Testing</div>...more'); $('.promo2').css("border", "1px solid gray"); } html document: <a href="javascript:ToggleTab(1);">try</a> <div class="divtab"></div> It works fine in Mozilla but not in IE. The actual data come from an ajax request but nothing can be selected in IE! Thanks a lot

    Read the article

  • Grouping parent node based on child elements values and sequence number.

    - by Mahir
    Hi, I need to transform XML using xslt. Logic: Split the parent if the parent having different child address and append the sequence number with parent name. Also need line number for the child. Here we may have number of parent nodes and each parent node may have more number of child nodes. I have tried numerous ways to achieve this and I am stuck with generating sequence number in the foreach. So can any one try and give a solution for this. Source XML as below: P1 CName1 Address1 CName2 Address2 CName3 Address1 P2 CName1 Address1 The target XML should as below: P1_1 CName1 Address1 1 CName2 Address2 2 CName3 Address1 P1_2 1 CName2 Address2 P2_1 1 CName1 Address1

    Read the article

  • How to create a MySQL query for time based elements with a 'safe window'?

    - by pj4533
    I am no SQL expert, far from it. I am writing a Rails application, and I am new at that as well. I come from a desktop programming background. My application has a table of data, one of the columns is the time at which the data was logged. I want to create a query with a 'safe window' around EACH row. By that I mean, it returns the first row, then for X minutes (based on the timelogged column) it won't return any data, once X minutes is up, it will return the next row. For example: ID | TimeLogged 1 | 3/5/2010 12:01:01 2 | 3/5/2010 12:01:50 3 | 3/5/2010 12:02:03 4 | 3/5/2010 12:10:30 5 | 3/5/2010 01:30:03 6 | 3/5/2010 01:31:05 With a 'safe window' of 5 minutes I want to create a query to return: 1 | 3/5/2010 12:01:01 4 | 3/5/2010 12:10:30 5 | 3/5/2010 01:30:03 (It skipped the 12:01:50 and 12:02:03 items because they occurred within 5 minutes of the first item.) Another example, with a 'safe window' of 15 minutes I want to return: 1 | 3/5/2010 12:01:01 5 | 3/5/2010 01:30:03 Perhaps I have to just return all data and parse it myself?

    Read the article

  • Using XSLT, how can I produce a table with elements at the position of the the node's attributes?

    - by Dr. Sbaitso
    Given the following XML: <items> <item> <name>A</name> <address>0</address> <start>0</start> <size>2</size> </item> <item> <name>B</name> <address>1</address> <start>2</start> <size>4</size> </item> <item> <name>C</name> <address>2</address> <start>5</start> <size>2</size> </item> </items> I want to generate the following output including colspan's +---------+------+------+------+------+------+------+------+------+ | Address | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +---------+------+------+------+------+------+------+------+------+ | 0 | | | | | | | A | +---------+------+------+------+------+------+------+------+------+ | 1 | | | B | | | +---------+------+------+------+------+------+------+------+------+ | 2 | | C | | | | | | +---------+------+------+------+------+------+------+------+------+ | 3 | | | | | | | | | +---------+------+------+------+------+------+------+------+------+ I think I would be able to accomplish this with a mutable xslt variable, but alas, there's no such thing. Is it even possible? How?

    Read the article

  • JQuery: loop through elements with more than one css class name that share only the first class name

    - by omaether
    Hello, I'm trying to use JQuery to loop through several div's with more than one class name, that all have the same first css class name and each one has a different second class name, e.g. <div class="maintext blue"> </div> <div class="maintext purple"> </div> <div class="maintext chartreuse"> </div> <div class="maintext puce"> </div> <div class="maintext lime"> </div> In JQuery I have tried $(".mainText").each(function (i) $(".mainText.*").each(function (i) $(".mainText" *).each(function (i) $(".mainText .*").each(function (i) But it will not select any of the divs with class="mainText ..." thanks for considering the question.

    Read the article

  • CouchDB emit with lookup key that is array, such that order of array elements are ignored.

    - by MatternPatching
    When indexing a couchdb view, you can emit an array as the key such as: emit(["one", "two", "three"], doc); I appreciate the fact that when searching the view, the order is important, but sometimes I would like the view to ignore it. I have thought of a couple of options. 1. By convention, just emit the contents in alphabetical order, and ensure that looking up uses the same convention. 2. Somehow hash in a manner that disregards the order, and emit/search based on that hash. (This is fairly easy, if you simply hash each one individually, "sum" the hashes, then mod.) Note: I'm sure this may be covered somewhere in the authoritative guide, but I was unsuccessful in finding it.

    Read the article

  • : for displaying all elements in a multidimensional array in python 3.1.

    - by Leif Andersen
    I have a multidimensional array in python like: arr = [['foo', 1], ['bar',2]] Now, if I want to print out everything in the array, I could do: print(arr[:][:]) Or I could also just do print(arr). However, If I only wanted to print out the first element of each box (for arr, that would be 'foo', 'bar'), I would imagine I would do something like: print(arr[:][0]) however, that just prints out the first data blog (['foo', 1]), also, I tried reversing it (just in case): print(arr[0][:]) and I got the same thing. So, is there anyway that I can get it to print the first element in each tuple (other than: for tuple in arr: print(tuple[0]) )? Thanks.

    Read the article

  • jQuery bug when trying to insert partial elements before() / after() ?

    - by RedGlobe
    I'm trying to wrap a div around an element (my 'template' div) by using jQuery's before() and after(). When I try to insert a closing after the selected element, it actually gets placed before the target. Example: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Div Wrap</title> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script> $('document').ready(function() { var beforestr = "<div id=\"wrap\"><div id=\"header\">Top</div><div id=\"page\">"; var afterstr = "</div><div id=\"footer\">Bottom</div></div>"; $('#template').before(beforestr); $('#template').after(afterstr); }); </script> </head> <body> <div id="template"> <h1>Page Title</h1> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. <script>document.write('This script should still work and might contain variables. Please don\'t recommend concatenation.');</script> Donec non enim in turpis pulvinar facilisis.</p> </div> </body> </html> The result is: <div id="wrap"> <div id="header">Top</div> <div id="page"> </div> </div> <div id="template"> <h1>Page Title</h1> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. This script should still work and might contain variables. Please don't recommend concatenation. Donec non enim in turpis pulvinar facilisis.</p> </div> <div id="footer">Bottom</div> Why are my closing wrap and page divs getting placed before the target, when I'm trying to place them after() ? Is there an alternative way to accomplish this (keeping in mind I may need to call script functions within the template div)? As I'm sure you're aware, best practices aren't what I'm going for here.

    Read the article

  • How do I most efficienty check the unique elements in a list?

    - by alex
    let's say I have a list li = [{'q':'apple','code':'2B'}, {'q':'orange','code':'2A'}, {'q':'plum','code':'2A'}] What is the most efficient way to return the count of unique "codes" in this list? In this case, the unique codes is 2, because only 2B and 2A are unique. I could put everything in a list and compare, but is this really efficient?

    Read the article

  • Why doesn't my <div> float around another floated <div> while other elements do?

    - by user1848605
    I have a container with background color green. Inside that green <div>, I have a <div> which is black and styled as a box (50px x 50px) - this <div> is floated to the left. Now if I add a <p> to my markup after the grey <div>, I'd expect it to float around the grey <div>. And it does. However, when I substitue with another <div> which is styled as box (set height and width), it doesn't float around anymore, but disappears behind the floating div. Even if I have first paragraphs which are floating around correctly and THEN I add the div (box), the paragraphs stop floating around and appear on another line. HTML: <div id="greencontainer"> <div id="blackbox"></div> <!--this one is float:left;--> <p>A paragraph that floats around the previous div</p> <div id="anotherbox"></div> <!-- if I add another div with set width and height, it disappears behind the floated one, and even prevents the paragraph from floating around.--> </div> CSS: #blackbox { width:50px; height:50px; background-color:black; float:left; } #p { margin:0px; padding:0px; } #anotherbox { width:50px; height:50px; background-color:grey; }

    Read the article

  • multiplying all elements in an array by an outside number?

    - by prodo
    I need to multiple all the values in an array by 3000 which in turn would create a new array that I will use to subtract from another array. I've tried to create a separate method that would do that for me but all I got back in the multiplied array was a bunch of numbers and symbols strangely? here is the code that I wrote public static void main(String[] args) { int numberOfTaxpayers = Integer.parseInt(JOptionPane.showInputDialog("Enter how many users you would like to calculate taxes for: "); int[] usernumChild = new int[numberOfTaxPayers]; for (int i = 0; i < usernumChild.length; i++) { usernumChild[i] = Integer.parseInt(JOptionPane.showInputDialog("Enter number of children for user "+ (i+1) +": ")); }//this for loop finds out the number of children per user so we can later multiply each input by 3000 to create an array that determine dependency exemption for each user int[] depndExemp = multiply(usernumChild, 3000);//this was the calling of the multiply method... somewhere here is the error!! }//end main method public static int[] multiply(int[] children, int number) { int array[] = new int[children.length]; for( int i = 0; i < children.length; i++) { children[i] = children[i] * number; }//end for return array; }//this is the method that I was shown in a previous post on how to create return an array in this the dependency exemption array but when I tested this by printing out the dependency array all I received were a jumble of wrong numbers.

    Read the article

  • What's the simplest way of defining lexicographic comparison for elements of a class?

    - by the_mandrill
    If I have a class that I want to be able to sort (ie support a less-than concept), and it has several data items such that I need to do lexicographic ordering then I need something like this: struct MyData { string surname; string forename; bool operator<(const MyData& other) const { return surname < other.surname || (surname==other.surname && forename < other.forename); } }; This becomes pretty unmanageable for anything with more than 2 data members. Are there any simpler ways of achieving it? The data members may be any Comparable class.

    Read the article

  • More efficient way to update multiple elements in javascript and/or jquery?

    - by Seiverence
    Say I have 6 divs with ID "#first", ""#second" ... "#sixth". Say if I wanted to execute functions on each of those divs, I would set up an array that contains each of the names of the divs I want to update as an element in the array of strings. ["first", "second", "third"] that I want to update. If I wanted to apply I function, I set up a for loop that iterates through each element in the array and say if I wanted to change the background color to red: function updateAllDivsInTheList() { for(var i = 0; i < array.size; i++) $("#"+array[i]).changeCssFunction(); } } Whenever I create a new div, i would add it to the array. The issue is, if I have a large number of divs that need to get updated, say if I wanted to update 1000 out of 1200 divs, it may be a pain/performance tank to have to sequentially iterate through every single element in the array. Is there some alternative more efficient way of updating multiple divs without having to sequentially iterate through every element in an array, maybe with some other more efficient data structure besides array? Or is what I am doing the most efficient way to do it? If can provide some example, that would be great.

    Read the article

  • How can I use Javascript to access sub-elements?

    - by Steve
    I am dynamically creating forms dynamically according to a users actions. It is an entry-box and a two "buttons" for each instance. Each instance will be wrapped in a unique div tag. What I tried to do without success is when I dynamically create the "button" I attach a function with the input variable containing the div of its instance. This a brief excerpt: var newDivClass = document.getElementById("instance"+1); button1.innerHTML = "<a href=\"#\" onclick=\"buttons("+newDivClass+");\" id=\"button1\"> Button1 </a>"; function buttons(selected) { //I want this to select the first instance //of button1 found within div newDivClass selected.getElementById("button1"); //I also tried //this.getElementById("button1"); //selected.getChildren[0]; } The problem appears to be in passing newDivClass to the the actual function.

    Read the article

  • What is the correct way to set size of elements of GUI?

    - by Roman
    I am using swing to create my GUI. J have a JFrame containing one main JPanel which, in its turn contain several JPanels which, in their turn, contain buttons. I would like to set certain sizes to mu buttons and JPanels. How does it work? Should I set sizes of my buttons and then the size of the JPanel and the JFrame will be set according to the buttons sizes? Or it works in the opposite direction? I set size for the JPanel and the size of the buttons will be set automatically?

    Read the article

  • Enumerate all k-partitions of 1d array with N elements?

    - by user301217
    This seems like a simple request, but google is not my friend because "partition" scores a bunch of hits in database and filesystem space. I need to enumerate all partitions of an array of N values (N is constant) into k sub-arrays. The sub-arrays are just that - a starting index and ending index. The overall order of the original array will be preserved. For example, with N=4 and k=2: [ | a b c d ] (0, 4) [ a | b c d ] (1, 3) [ a b | c d ] (2, 2) [ a b c | d ] (3, 1) [ a b c d | ] (4, 0) I'm pretty sure this isn't an original problem (and no, it's not homework), but I'd like to do it for every k <= N, and it'd be great if the later passes (as k grows) took advantage of earlier results. If you've got a link, please share.

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >