Search Results

Search found 4616 results on 185 pages for 'lists'.

Page 22/185 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • problem with jquery sortable of ul with childrens - how to allow li to be sorted only on the same le

    - by Y.G.J
    $(document).ready(function() { $("#test-list").sortable({ items: "> li", handle : '.handle', axis: 'y', opacity: 0.6, update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); $("#test-sub").sortable({ containment: "ul", items: "li", handle : '.handle2', axis: 'y', opacity: 0.6, update : function () { var order = $('ul').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); }); <ul id="test-list"> <li id="listItem_10">first<img align="middle" src="Themes/arrow.png" class="handle" /></li> <li id="listItem_8">second<img align="middle" src="Themes/arrow.png" class="handle" /> <ul id="test-sub"> <li id="listItem_4><img align="middle" src="Themes/arrow.png" class="handle2" /></li> <li id="listItem_3"><img align="middle" src="Themes/arrow.png" class="handle2" /></li> <ul id="test-sub"> <li id="listItem_9"><img align="middle" src="Themes/arrow.png" class="handle2" /></li> </ul> </li> </ul> </li> </ul> the problems i have: sorting the main ul is working but not all the time - i will try to fix that my own but if there is a problem with the code here and not the one in proccess-sortable - tell me. moving li in the main ul is ok but the sub or the sub of the sub is having problem - i can drag something from one sub to it's sub or the other way too - i don't want that to happend. i want to be able to drag li and by selecting that one that only this ul group will send to proccess-sortable to be updated - how can i catch the specific ul of li i am draging?

    Read the article

  • Are there C# controls that can be used to create a hierarchical list of prioritised items?

    - by Mendokusai
    I need to be able to display and edit a hierarchical list of tasks in a C# app. It can either be a Windows form app, or ASP.NET. Basically, I want similar behaviour to the way Microsoft Project handles tasks. The control would need to: 1) Maintain a list of items made up of several fields 2) Each item can have a number of children (at least 3 levels of nesting) 3) It needs to be very easy to change the parents/children of an item 4) It needs to be very easy to edit the fields (as fast as changing cells in Excel) 5) It needs to be very easy to reorder the items by dragging and dropping or cut and paste 6) If I can easily connect the control to a database, even better Before I go and create something manually, I'm wondering if there is something available already?

    Read the article

  • How to use iterator in nested arraylist

    - by Muhammad Abrar
    I am trying to build an NFA with a special purpose of searching, which is totally different from regex. The State has following format class State implements List{ //GLOBAL DATA static int depth; //STATE VALUES String stateName; ArrayList<String> label = new ArrayList<>(); //Label for states //LINKS TO OTHER STATES boolean finalState; ArrayList<State> nextState ; // Link with multiple next states State preState; // previous state public State() { stateName = ""; finalState = true; nextState = new ArrayList<>(); } public void addlabel(String lbl) { if(!this.label.contains(lbl)) this.label.add(lbl); } public State(String state, String lbl) { this.stateName = state; if(!this.label.contains(lbl)) this.label.add(lbl); depth++; } public State(String state, String lbl, boolean fstate) { this.stateName = state; this.label.add(lbl); this.finalState = fstate; this.nextState = new ArrayList<>(); } void displayState() { System.out.print(this.stateName+" --> "); for(Iterator<String> it = label.iterator(); it.hasNext();) { System.out.print(it.next()+" , "); } System.out.println("\nNo of States : "+State.depth); } Next, the NFA class is public class NFA { static final String[] STATES= {"A","B","C","D","E","F","G","H","I","J","K","L","M" ,"N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; State startState; State currentState; static int level; public NFA() { startState = new State(); startState = null; currentState = new State(); currentState = null; startState = currentState; } /** * * @param st */ NFA(State startstate) { startState = new State(); startState = startstate; currentState = new State(); currentState = null; currentState = startState ; // To show that their is only one element in NFA } boolean insertState(State newState) { newState.nextState = new ArrayList<>(); if(currentState == null && startState == null ) //if empty NFA { newState.preState = null; startState = newState; currentState = newState; State.depth = 0; return true; } else { if(!Exist(newState.stateName))//Exist is used to check for duplicates { newState.preState = currentState ; currentState.nextState.add(newState); currentState = newState; State.depth++; return true; } } return false; } boolean insertState(State newState, String label) { newState.label.add(label); newState.nextState = null; newState.preState = null; if(currentState == null && startState == null) { startState = newState; currentState = newState; State.depth = 0; return true; } else { if(!Exist(newState.stateName)) { newState.preState = currentState; currentState.nextState.add(newState); currentState = newState; State.depth++; return true; } else { ///code goes here } } return false; } void markFinal(State s) { s.finalState = true; } void unmarkFinal(State s) { s.finalState = false; } boolean Exist(String s) { State temp = startState; if(startState.stateName.equals(s)) return true; Iterator<State> it = temp.nextState.iterator(); while(it.hasNext()) { Iterator<State> i = it ;//startState.nextState.iterator(); { while(i.hasNext()) { if(i.next().stateName.equals(s)) return true; } } //else // return false; } return false; } void displayNfa() { State st = startState; if(startState == null && currentState == null) { System.out.println("The NFA is empty"); } else { while(st != null) { if(!st.nextState.isEmpty()) { Iterator<State> it = st.nextState.iterator(); do { st.displayState(); st = it.next(); }while(it.hasNext()); } else { st = null; } } } System.out.println(); } /** * @param args the command line arguments */ /** * * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here NFA l = new NFA(); State s = new State("A11", "a",false); NFA ll = new NFA(s); s = new State("A111", "a",false); ll.insertState(s); ll.insertState(new State("A1","0")); ll.insertState(new State("A1111","0")); ll.displayNfa(); int j = 1; for(int i = 0 ; i < 2 ; i++) { int rand = (int) (Math.random()* 10); State st = new State(STATES[rand],String.valueOf(i), false); if(l.insertState(st)) { System.out.println(j+" : " + STATES[rand]+" and "+String.valueOf(i)+ " inserted"); j++; } } l.displayNfa(); System.out.println("No of states inserted : "+ j--); } I want to do the following This program always skip to display the last state i.e. if there are 10 states inserted, it will display only 9. In exist() method , i used two iterator but i do not know why it is working I have no idea how to perform searching for the existing class name, when dealing with iterators. How should i keep track of current State, properly iterate through the nextState List, Label List in a depth first order. How to insert unique States i.e. if State "A" is inserted once, it should not insert it again (The exist method is not working) Best Regards

    Read the article

  • sorting nested list, allow only li to be sorted witin the same ul

    - by Y.G.J
    what i want to achive is: sorting the main ul is working but not all the time - i will try to fix that my own but if there is a problem with the code here and not the one in proccess-sortable - tell me. moving li in the main ul is ok but the sub or the sub of the sub is having problem - i can drag something from one sub to it's sub or the other way too - i don't want that to happend. i want to be able to drag li and by selecting that one that only this ul group will send to proccess-sortable to be updated - how can i catch the specific ul of li i am draging? $(document).ready(function() { $("#test-list").sortable({ items: "> li", handle : '.handle', axis: 'y', opacity: 0.6, update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); $("#test-sub").sortable({ containment: "ul", items: "li", handle : '.handle2', axis: 'y', opacity: 0.6, update : function () { var order = $('ul').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); }); this is the html part <ul id="test-list"> <li id="listItem_10">first<img align="middle" src="Themes/arrow.png" class="handle" /></li> <li id="listItem_8">second<img align="middle" src="Themes/arrow.png" class="handle" /> <ul id="test-sub"> <li id="listItem_4><img align="middle" src="Themes/arrow.png" class="handle2" /></li> <li id="listItem_3"><img align="middle" src="Themes/arrow.png" class="handle2" /></li> <ul id="test-sub"> <li id="listItem_9"><img align="middle" src="Themes/arrow.png" class="handle2" /></li> </ul> </li> </ul> </li> </ul>

    Read the article

  • Displaying list of objects as single column in a bound gridview (Winforms)?

    - by Carrie Nelson
    I have a gridview that is bound to a datasource on a Windows Form (VB.NET). The grid displays a list of "certifications", and each "certification" can be associated with many languages. So in the grid, I'd like to display "languages" as a column, and display a comma delimited list of the language names for each "certification". In the "certification" class, one of the properties is a list of "language" objects, and each "language" has an ID (guid), name (string), and value (integer). So in the datasource, I have the list of "languages", but I can't figure out how to display them in a column on the grid. The gridview won't let me add the language list property as a column. So is the ONLY way to add a new property on the "certification" class, which returns a string that contains the comma delimited list, and show THAT on the grid? Or is there a way to display that list of "languages"?

    Read the article

  • WebKit doesn't paint background-color for entire width of final inline list item

    - by Jay
    On our website http://www.dimagi.com, the items in the jQuery menu near the top of the screen gain a background-color on hover. The hover background-color of the rightmost list item ("About Us") is cut off at the very right edge of the text, seemingly only in WebKit (tested Safari and Chrome in Windows XP). Can anybody see what I might be doing wrong in the CSS? Or is this some obscure WebKit bug?

    Read the article

  • What's wrong with my destructor?

    - by Ahmed Sharara
    // Sparse Array Assignment.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> using namespace std; struct node{ int row; int col; int value; node* next_in_row; node* next_in_col; }; class MultiLinkedListSparseArray { private: char *logfile; node** rowPtr; node** colPtr; // used in constructor node* find_node(node* out); node* ins_node(node* ins,int col); node* in_node(node* ins,node* z); node* get(node* in,int row,int col); bool exist(node* so,int row,int col); node* dummy; int rowd,cold; //add anything you need public: MultiLinkedListSparseArray(int rows, int cols); ~MultiLinkedListSparseArray(); void setCell(int row, int col, int value); int getCell(int row, int col); void display(); void log(char *s); void dump(); }; MultiLinkedListSparseArray::MultiLinkedListSparseArray(int rows,int cols){ rowPtr=new node* [rows+1]; colPtr=new node* [cols+1]; for(int n=0;n<=rows;n++) rowPtr[n]=NULL; for(int i=0;i<=cols;i++) colPtr[i]=NULL; rowd=rows;cold=cols; } MultiLinkedListSparseArray::~MultiLinkedListSparseArray(){ cout<<"array is deleted"<<endl; for(int i=rowd;i>=0;i--){ for(int j=cold;j>=0;j--){ if(exist(rowPtr[i],i,j)) delete get(rowPtr[i],i,j); } } // it stops in the last loop & doesnt show the done word cout<<"done"<<endl; delete [] rowPtr; delete [] colPtr; delete dummy; } void MultiLinkedListSparseArray::log(char *s){ logfile=s; } void MultiLinkedListSparseArray::setCell(int row,int col,int value){ if(exist(rowPtr[row],row,col)){ (*get(rowPtr[row],row,col)).value=value; } else{ if(rowPtr[row]==NULL){ rowPtr[row]=new node; (*rowPtr[row]).value=value; (*rowPtr[row]).row=row; (*rowPtr[row]).col=col; (*rowPtr[row]).next_in_row=NULL; (*rowPtr[row]).next_in_col=NULL; } else if((*find_node(rowPtr[row])).col<col){ node* out; out=find_node(rowPtr[row]); (*out).next_in_row=new node; (*((*out).next_in_row)).col=col; (*((*out).next_in_row)).row=row; (*((*out).next_in_row)).value=value; (*((*out).next_in_row)).next_in_row=NULL; } else if((*find_node(rowPtr[row])).col>col){ node* ins; ins=in_node(rowPtr[row],ins_node(rowPtr[row],col)); node* g=(*ins).next_in_row; (*ins).next_in_row=new node; (*((*ins).next_in_row)).col=col; (*(*ins).next_in_row).row=row; (*(*ins).next_in_row).value=value; (*(*ins).next_in_row).next_in_row=g; } } } int MultiLinkedListSparseArray::getCell(int row,int col){ return (*get(rowPtr[row],row,col)).value; } void MultiLinkedListSparseArray::display(){ for(int i=1;i<=5;i++){ for(int j=1;j<=5;j++){ if(exist(rowPtr[i],i,j)) cout<<(*get(rowPtr[i],i,j)).value<<" "; else cout<<"0"<<" "; } cout<<endl; } } node* MultiLinkedListSparseArray::find_node(node* out) { while((*out).next_in_row!=NULL) out=(*out).next_in_row; return out; } node* MultiLinkedListSparseArray::ins_node(node* ins,int col){ while(!((*ins).col>col)) ins=(*ins).next_in_row; return ins; } node* MultiLinkedListSparseArray::in_node(node* ins,node* z){ while((*ins).next_in_row!=z) ins=(*ins).next_in_col; return ins; } node* MultiLinkedListSparseArray::get(node* in,int row,int col){ dummy=new node; dummy->value=0; while((*in).col!=col){ if((*in).next_in_row==NULL){ return dummy; } in=(*in).next_in_row; } return in; } bool MultiLinkedListSparseArray::exist(node* so,int row,int col){ if(so==NULL) return false; else{ while((*so).col!=col){ if((*so).next_in_row==NULL) return false; else so=(*so).next_in_row; } return true; } }

    Read the article

  • Testing a (big) collection retrieved from a db

    - by Bas
    I'm currently doing integration testing on a live database and I have the following sql statement: var date = DateTime.Parse("01-01-2010 20:30:00"); var result = datacontext.Repository<IObject>().Where(r => r.DateTime > date).First(); Assert.IsFalse(result.Finished); I need to test if the results retrieved from the statement, where the given date is less then the date of the object, have Finished set to False. I do not know how many results I get back and currently I'm getting the first object of the list and check if that object has Finished set to false. I know testing only the first item of the list is not valid testing, as a solution for that I could iterate through the list and check all items on Finished, but putting logic in a Test is kinda going against the concept of writing 'good' tests. So my question is: Does anyone have a good solution of how to properly test the results of this list?

    Read the article

  • jquery skip list item

    - by steve
    Is there a way for a jQuery function to "skip" an li? Such as Having 3 list items, you click on the 1st one, it calls a next() function, and skips the 2nd li and goes to the 3rd. Current code is here: $('ul.gallery li').click(function() { $(window).scrollTo($(this).next('li'), 800, {easing:'easeOutCirc', axis:'x', offset:-50 } ); }); I want it to skip the immediate li and go to the one after that.

    Read the article

  • Python: How do sets work

    - by Guy
    I have a list of objects which I want to turn into a set. My objects contain a few fields that some of which are o.id and o.area. I want two objects to be equal if these two fields are the same. ie: o1==o2 if and only if o1.area==o2.area and o1.id==o2.id. I tried over-writing __eq__ and __cmp__ but I get the error: TypeError: unhashable instance. What should I over-write?

    Read the article

  • Building "isolated" and "automatically updated" caches (java.util.List) in Java.

    - by Aidos
    Hi Guys, I am trying to write a framework which contains a lot of short-lived caches created from a long-living cache. These short-lived caches need to be able to return their entier contents, which is a clone from the original long-living cache. Effectively what I am trying to build is a level of transaction isolation for the short-lived caches. The user should be able to modify the contents of the short-lived cache, but changes to the long-living cache should not be propogated through (there is also a case where the changes should be pushed through, depending on the Cache type). I will do my best to try and explain: master-cache contains: [A,B,C,D,E,F] temporary-cache created with state [A,B,C,D,E,F] 1) temporary-cache adds item G: [A,B,C,D,E,F] 2) temporary-cache removes item B: [A,C,D,E,F] master-cache contains: [A,B,C,D,E,F] 3) master-cache adds items [X,Y,Z]: [A,B,C,D,E,F,X,Y,Z] temporary-cache contains: [A,C,D,E,F] Things get even harder when the values in the items can change and shouldn't always be updated (so I can't even share the underlying object instances, I need to use clones). I have implemented the simple approach of just creating a new instance of the List using the standard Collection constructor on ArrayList, however when you get out to about 200,000 items the system just runs out of memory. I know the value of 200,000 is excessive to iterate, but I am trying to stress my code a bit. I had thought that it might be able to somehow "proxy" the list, so the temporary-cache uses the master-cache, and stores all of it's changes (effectively a Memento for the change), however that quickly becomes a nightmare when you want to iterate the temporary-cache, or retrieve an item at a specific index. Also given that I want some modifications to the contents of the list to come through (depending on the type of the temporary-cache, whether it is "auto-update" or not) and I get completly out of my depth. Any pointers to techniques or data-structures or just general concepts to try and research will be greatly appreciated. Cheers, Aidos

    Read the article

  • Recommendations for C# controls that can be used to create a hierarchical list of prioritised items?

    - by Mendokusai
    I need to be able to display and edit a hierarchical list of tasks in a C# app. It can either be a Windows form app, or ASP.NET. Basically, I want similar behaviour to the way Microsoft Project handles tasks. The control would need to: 1) Maintain a list of items made up of several fields 2) Each item can have a number of children (at least 3 levels of nesting) 3) It needs to be very easy to change the parents/children of an item 4) It needs to be very easy to edit the fields (as fast as changing cells in Excel) 5) It needs to be very easy to reorder the items by dragging and dropping or cut and paste 6) If I can easily connect the control to a database, even better Anyone got any recommendations for controls for me to look at?

    Read the article

  • How to maintain an ordered table with Core Data (or SQL) with insertions/deletions?

    - by Jean-Denis Muys
    This question is in the context of Core Data, but if I am not mistaken, it applies equally well to a more general SQL case. I want to maintain an ordered table using Core Data, with the possibility for the user to: reorder rows insert new lines anywhere delete any existing line What's the best data model to do that? I can see two ways: 1) Model it as an array: I add an int position property to my entity 2) Model it as a linked list: I add two one-to-one relations, next and previous from my entity to itself 1) makes it easy to sort, but painful to insert or delete as you then have to update the position of all objects that come after 2) makes it easy to insert or delete, but very difficult to sort. In fact, I don't think I know how to express a Sort Descriptor (SQL ORDER BY clause) for that case. Now I can imagine a variation on 1): 3) add an int ordering property to the entity, but instead of having it count one-by-one, have it count 100 by 100 (for example). Then inserting is as simple as finding any number between the ordering of the previous and next existing objects. The expensive renumbering only has to occur when the 100 holes have been filled. Making that property a float rather than an int makes it even better: it's almost always possible to find a new float midway between two floats. Am I on the right track with solution 3), or is there something smarter?

    Read the article

  • List overwriting data on all positions

    - by elvispt
    I created a class with 3 fields: class Gente { int _ID; string _nome, _sexo; public Gente() { _ID = 0; _nome = ""; _sexo = ""; } public int ID { set { _ID = value; } get { return _ID; } } public string Nome { set { _nome = value; } get { return _nome; } } public string Sexo { set { _sexo = value; } get { return _sexo; } } } Then I declared a List from that class and an object from that class so that I can be able to add to the List. List<Gente> Alunos = new List<Gente>(); Gente professor = new Gente(); The first time I do the Alunos.Add(professor); to the list it correctly sends the information to the 0 position. But when I do it second time it overwrites everything on position 0 with the new data besides adding the new data to a new position, 1.

    Read the article

  • How to get Date and current time from the Date/Time column in SharePoint Custom list

    - by Kanta
    I have column called "Date Submitted" as Date/time in one of the Custom list in sharepoint 2007. it always set to today's date and 12AM time instead of that I want to display today's date with current time hh:mm:ss. I tried creating calculated column TestDate and formula is : =TEXT(([Date Submitted]),"mm dd yyyy h:MM:SS") result is 04 28 2010 0:00:00 I wanted to be 04/28/2010 10:50:34 Is it possible to achive this? Thank you kanta

    Read the article

  • Using perfectly formatted input as list in Haskell

    - by RankWeis
    I'm doing a program in Haskell (on the Haskell platform), and I know I'm getting perfectly formatted inputs, so the input may look like [ ['a'], ['b'], ['c'] ] I want Haskell to be able to take this and use it as a list of it's own. And, I'd like this list to be over multiple lines, i.e., I want this to also work: [ ['a'], ['b'], ['c'] ] I can parse this input, but I've been told there's a way to do this easily - this is supposed to be the 'trivial' part of the assignment, but I don't understand it.

    Read the article

  • CSS: Horizontal UL: Getting it centered

    - by Steve
    I'm trying to make a horizontal menu/list. It has a mix of independent buttons and buttons that are wrapped in their own individual forms. With much hacking I got all of the buttons, in forms and not in forms to align horizontally. I haven't been able to get the whole thing to center on the page though. Could someone point out to me what I am not seeing? <!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> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <link rel="shortcut icon" href="http://localhost:7001/nsd/images/favicon.ico"> <link rel="StyleSheet" href="veci_files/nsd.css" type="text/css"> <style type = "text/css"> #horizontal_li_menu_container ul { margin-left: auto; margin-right:auto; text-align:center; border: 1px solid green; width:1000px; } #horizontal_li_menu_container_ul { list-style-type: none; text-decoration: none; border: 1px solid red; } #horizontal_li_menu_container li { display: inline;float:left; } </style> </head> <body> <div id = "horizontal_li_menu_container"> <ul id = "horizontal_li_menu_container_ul"> <li> <input value="Update" onclick="location.href='#'" name="button" type="button"/> </li> <li> <form name="formExportVECI" method="post" action="exportveci"> <input name="person_id" value="661774" type="hidden"> <input name="submitExport" value="Export To Microsoft Excel" type="submit"> </form> </li> <li> <form id="ufdh" name="formImportVECI" action="importveci" method="post" enctype="multipart/form-data"> <input name="person_id" value="661774" type="hidden"> <input value="Import From Microsoft Excel" path="Upload" type="submit"> <input id="fileData" name="fileData" value="" type="file"> </form> </li> <li> <input value="Search/Home" onclick="location.href='search'" name="buttonHome" type="button"/> </li> </ul> </div> </body></html>

    Read the article

  • Efficient way to maintain a sorted list of access counts in Python

    - by David
    Let's say I have a list of objects. (All together now: "I have a list of objects.") In the web application I'm writing, each time a request comes in, I pick out up to one of these objects according to unspecified criteria and use it to handle the request. Basically like this: def handle_request(req): for h in handlers: if h.handles(req): return h return None Assuming the order of the objects in the list is unimportant, I can cut down on unnecessary iterations by keeping the list sorted such that the most frequently used (or perhaps most recently used) objects are at the front. I know this isn't something to be concerned about - it'll make only a miniscule, undetectable difference in the app's execution time - but debugging the rest of the code is driving me crazy and I need a distraction :) so I'm asking out of curiosity: what is the most efficient way to maintain the list in sorted order, descending, by the number of times each handler is chosen? The obvious solution is to make handlers a list of (count, handler) pairs, and each time a handler is chosen, increment the count and resort the list. def handle_request(req): for h in handlers[:]: if h[1].handles(req): h[0] += 1 handlers.sort(reverse=True) return h[1] return None But since there's only ever going to be at most one element out of order, and I know which one it is, it seems like some sort of optimization should be possible. Is there something in the standard library, perhaps, that is especially well-suited to this task? Or some other data structure? (Even if it's not implemented in Python) Or should/could I be doing something completely different?

    Read the article

  • Fancy Box to Popup an HTML Page from One List Item in an Unordered List

    - by nicorellius
    I have an unordered list: <ul> <li><a id="fancy_popup" href="popup.html" class="fancybox"> Popup HTML Link</a></li> <li><a href="other.html">Other HTML Link</a></li> <li><a href="other.html">Other HTML Link</a></li> </ul> And I have a jQuery script: <script type="text/javascript"> $(document).ready(function() { $("#fancy_popup").fancybox({ transitionIn : 'elastic', transitionOut : 'elastic', easingIn : 'easeInSine', easingOut : 'easeOutSine', speedIn : 400, speedOut : 200, titlePosition : 'inside', titleFormat : 'document.write("Fancy Box Title");', cyclic : true }); }); </script> This jQuery Fancy Box script works elsewhere, with a div that has the id="fancy_popup" so I thought why not add it to the anchor directly in this case... I'm trying to figure out how to apply Fancy Box so that when someone clicks the Popup HTML link above, a Fancy Box window pops up, according to the script. I've tried variations with placing the id on the li, on the ul and manipulating the script for these selectors to no avail. Any help is appreciated.

    Read the article

  • trying to make an accordion menu from a list - jquery indexhibit

    - by orionrush
    Hello - Im teaching my self javascript & jquery so this might be a bit of a low brow question or entirely too much code for anyone to wade through, but Im hoping for some feedback. I have looked around and haven't found a thread that looks like it will deals neatly with my question. Im using the cms indexhibit (cant create a new tag!) and trying to create an accordion style menu from the menu list it generates. I basically have the behaviour Im after, modifying an existing bit of work but there are quite a few foibles, which are no doubt a conflict between the .click and .toggle and a confused use if statements. I basically want to start from scratch and redo this so I can a) learn from my mistakes b) understand what's happening. Im having trouble now because I dont know where to go from here, or how to trouble shoot it. Can anyone give me a quick analysis how the the script in the head of the document work together? Also any insight into the nature of the conflicts Im seeing and what approach might take to remedy them? If you were going to start afresh what would be your approach? Here is a test to see it in action (warts and all): http://stillstatic.nfshost.com/ This script goes into the document head: <script type='text/javascript'> //im not entirely clear as to what this achieves path = 'path/to/script/'; $(document).ready(function() { setTimeout('move_up()', 1); expandingMenu(0); expandingMenu(1); expandingMenu(2); expandingMenu(3); expandingMenu(4); //etc }); </script> the generated list: <ul> <li class='section-title active_menu'>blogs</li> <li><a class="active" href='#' onclick="do_click();">3</a></li> </ul> <ul> //this menu section dose not have a label: class .section-title <li><a href='#' onclick="do_click();">1</a></li> <li><a href='#' onclick="do_click();">2</a></li> </ul> <ul> //this menu section is not the 'active menu' this is achieved by the jquery script <li class='section-title'>writing</li> <li><a href='#' onclick="do_click();">4</a></li> <li><a href='#' onclick="do_click();">5</a></li> </ul> The meat of in an external script: function expandingMenu(num) { var speed = 500; var menu_title = $("#menu ul").eq(num).children(":first"); // ie. first child be the title with the class .section-title unless the user turned it off var menu_items = $("#menu ul").eq(num).children().filter(function (index) { return index 0; }); // ie. any li NOT in position 0, below li.section-title if (menu_items.is(".active") == true) { menu_title.addClass("active_menu"); //Add a class to the active list so we can style it. } if (menu_title.is(".section-title") == true){ // this if prevents interference with users who turn off the section titling if ((menu_items.is(".active") == false) && (menu_items.is(":visible")) ) { menu_items.hide(0);// first we hide the inactive exhibits } $('li').click(function (){ if ( (menu_title.is(":visible") == true) ){ menu_items.hide(speed); } if ( (menu_items.is(":hidden") == true ) && (('')) ){// ?! without this second condition things break down. . . menu_items.show(speed); } }) menu_title.css({cursor:"pointer"}).toggle( // add click functions + pointer to menu_title function () { menu_items.show(speed);//Open it up }, function () { // this function could even be empty but without the if things get weird if (menu_items.is(".xx")) menu_items.hide(speed); //Take the menu item off of active duty! } ) } }

    Read the article

  • Any big difference between using contains or loop through a list?

    - by Nazgulled
    Hi, Performance wise, is there really a big difference between using: ArrayList.contains(o) vs foreach|iterator LinkedList.contains(o) vs foreach|iterator HashMap.(containsKey|containsValue) vs foreach|iterator TreeMap.(containsKey|containsValue) vs foreach|iterator Of course, for the foreach|iterator loops, I'll have to explicitly compare the methods and return true or false accordingly. The object I'm comparing is an object where equals() and hashcode() are both properly overridden.

    Read the article

  • floating in list causes trouble in IE6 and IE7

    - by Thom
    I have a toggle list that causes trouble in old IE browsers, tried to fix it for couple of hours but I failed again and again. Please check out the jsfiddle code: http://jsfiddle.net/vny63/ structure is similar to this: <li class="toggle"> <a class="left" title="gallery">gallery</a> (English) <span class="right float_right">3</span> <ul style="display: none;"> <li class="space_left"> lot of stuff here </li> </ul> </li> It is working well in IE8 and Firefox3

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >