Search Results

Search found 1146 results on 46 pages for 'divs'.

Page 14/46 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Javascript childNodes does not find all children of a div when appendchild has been used

    - by yesterdayze
    Alright, I am hoping someone can help me out. I apologize up front that this one may be confusing. I have included an example to try to help ease the confusion as this is better seen then heard. I have created a webpage that contains a group or set of groups. Each group has a subgroup. In a nutshell what is happening is this page will allow me to combine multiple groups containing subgroups into a new group. The page will give the chance to rename the old subgroups before they are combined into new groups in order to avoid confusion. When a group is renamed it will check to make sure there is not already a group with that name. If there is it will copy itself out of it's own group and into that group and then delete the original. If the group does not already exist it will create that group, copy itself in and then delete the original. Subgroups can also be renamed at which point they will move into the group with the same name if it exists, or create a new one if it doesn't. The page has a main div. The main div contains 'new sub group' divs. Inside each of those is another div containing the 'old sub group' divs. I use a loop through the child nodes of the 'new sub group' div when renaming a group in order to find each child node. These are then copied into a new div within the main div. The crux of the problem is this. If I loop through a DIV and copy all of the DIVs in it into a new or existing DIV all is well. When I then try to take that DIV and copy all of it's DIVs into another or new DIV it always skips one of the moved DIVs. For simplicity I have copied the entire working code below. To recreate the issue click the spot where the image should appear next to the name ewrewrwe and rename it to something else. All is well. Now click that new group the same way and name it something else. You will see it skip one each time. I have linked the page here: http://vtbikenight.com/test.html The link is clean, it is my personal website I use for a local motorycle group I am part of. Thanks for the help everyone!!! Please let me know if I can clarify on anything. I know the code is not the best right now, it is just demo code and my intent is to get the concept working then streamline it all.

    Read the article

  • Container fix width. Center div dynamic width. want left right divs to fill out remaining width equally

    - by james
    Have Three columns..Combine width of all three is fixed.. 2nd ( center ) column will have dynamic content.. I need left and right column to fill out remaining space ( container width - center column dynamic width )equally. Example: http://jsfiddle.net/htKje/ <div class="container"> <div class="bg"></div> <div>Lorem Ipsum</div> <div class="bg"></div> </div> CSS : .container { width:500px; } .bg {backgrould:#CCC; }

    Read the article

  • GWT Html Layout Conventions

    - by brad
    I've just started working with GWT and I'm already recognizing the extraordinary power that it possesses. I'm coming from a frontend world so the Java is a big learning curve, but I think that will actually help me build a properly laid out app (html-wise) instead of just relying on the default GWT panels that often end up using tables for layout, or superfluous, absolutely positioned divs. The biggest thing slowing me down right now however is deciding how to properly lay out the design of my site. I've got a pretty standard 2-col header/foot site (fixed width) that I want to design, but I'm not a fan of all the extra divs/styling etc that come with the DockLayoutPanel for instance. I'm thinking that I should just write my own Layout widget extending Composite that has HTMLPanels for the general site layout (I think... still haven't fully figured that out yet, ie. how do I add ID's to these panel divs "#header", "#nav" etc...) then I can add other widgets into this layout But the other thing I'm seeing is that I could write a Layout class extending UiBuilder and have straight up divs in the ui.xml file. I'm just wondering, what is the preferred method for site layout with GWT? This isn't going to be re-used in the sense of other widgets, it will be used once and my controls etc will be placed inside. Any tips or tricks are greatly appreciated! And if I've completely missed the boat on how to do this, let me know

    Read the article

  • Why not use tables for layout in HTML?

    - by Bno
    It seems to be the general opinion that tables should not be used for layout in HTML. Why? I have never (or rarely to be honest) seen good arguments for this. The usual answers are: It's good to separate content from layoutBut this is a fallacious argument; Cliche Thinking. I guess it's true that using the table element for layout has little to do with tabular data. So what? Does my boss care? Do my users care?Perhaps me or my fellow developers who have to maintain a web page care... Is a table less maintainable? I think using a table is easier than using divs and CSS.By the way... why is using a div or a span good separation of content from layout and a table not? Getting a good layout with only divs often requires a lot of nested divs. Readability of the codeI think it's the other way around. Most people understand html, few understand CSS. It's better for SEO not to use tablesWhy? Can anybody show some evidence that it is? Or a statement from Google that tables are discouraged from an SEO perspective? Tables are slower.An extra tbody element has to be inserted. This is peanuts for modern web browsers. Show me some benchmarks where the use of a table significantly slows down a page. A layout overhaul is easier without tables, see css Zen Garden.Most web sites that need an upgrade need new content (html) as well. Scenarios where a new version of a web site only needs a new CSS file are not very likely. Zen Garden is a nice web site, but a bit theoretical. Not to mention its misuse of CSS. I am really interested in good arguments to use divs + CSS instead of tables.

    Read the article

  • In CSS, how to not float a 300px wide Div to the next line?

    - by Jian Lin
    Say, there is a bar that is styled at the bottom of the viewport, using position: fixed; bottom: 0; left: 0; width: 100%; height 50px; overflow: hidden and then there are 4 Divs inside it, each one floated to the left. Each Div is about 300px wide or can be more (depending on the content) Now, when the window is 1200 pixel wide, and we see all 4 Divs, but when the window is resize to be 1180 pixel wide (just 20 pixels less), then the whole 300px wide Div will disappear, because it is "floated" to the next line. So how can this be made so that, the Div will stay there and showing 280px of itself, rather than totally disappear? By the way, white-space: nowrap won't work as that probably has to do with not wrapping inline content. I was thinking of putting another Div inside this Div, having a fixed width of 1200px or 2000px, so that all Divs will float on the same level in this inner Div, and the outer Div will cut it off with the overflow: hidden. But this seems more like a hack... since the wide of all those Divs can be dynamic, and setting a fixed width of 1200px or 2000px seems like too much of a hack.

    Read the article

  • jQuery: Stopping a periodic ajax call?

    - by Legend
    I am writing a small jQuery plugin to update a set of Divs with content obtained using Ajax calls. Initially, let's assume we have 4 divs. I am doing something like this: (function($) { .... .... //main function $.fn.jDIV = { init: function() { ... ... for(var i = 0; i < numDivs; i++) { this.query(i); } this.handlers(); }, query: function(divNum) { //Makes the relevant ajax call }, handlers: function() { for(var i = 0; i < numDivs; i++) { setInterval("$.fn.jDIV.query(" + i + ")", 5000); } } }; })(jQuery); I would like to be able to enable and disable a particular ajax query. I was thinking of adding a "start" and "stop" instead of the "handlers" function and subsequently storing the setInterval handler like this: start: function(divNum) { divs[divNum] = setInterval("$.fn.jDIV.query(" + i + ")", 5000); }, stop: function(divNum) { clearInterval(divs[divNum]); } I did not use jQuery to setup and destroy the event handlers. Is there a better approach (perhaps using more of jQuery) to achieve this?

    Read the article

  • jQuery API counter++ pause on hover and then resume

    - by Rory
    I need to have this counter pause {stay on current div) while mouseover or hover and resume counter when mouseout. I have tried many ways but still new to jQuery API. <div id="slide_holder"> <div id="slide1" class="hidden"> <img src="images/crane2.jpg" class="fill"> </div> <div id="slide2" class="hidden"> <img src="images/extend_boom.png" class="fill"> </div> <div id="slide3" class="hidden"> <img src="images/Transformers-Bumblebee.jpg" class="fill"> </div> <script> $(function () { var counter = 0, divs = $('#slide1, #slide2, #slide3'); function showDiv () { divs.hide() // hide all divs .filter(function (index) { return index == counter % 3; }) // figure out correct div to show .fadeIn('slow'); // and show it counter++; }; // function to loop through divs and show correct div showDiv(); // show first div setInterval(function () { showDiv(); // show next div }, 3 * 1000); // do this every 10 seconds }); </script>

    Read the article

  • jquery pagination plugin doesn't quite work right for me...

    - by Pandiya Chendur
    My page has the following jquery statements, <script type="text/javascript"> $(document).ready(function() { getRecordspage(1, 5); }); </script> It works fine but how to add callback function to my pagination( callback://)? function getRecordspage(curPage, pagSize) { $.ajax({ type: "POST", url: "Default.aspx/GetRecords", data: "{'currentPage':" + curPage + ",'pagesize':" + pagSize + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(jsonObj) { var strarr = jsonObj.d.split('##'); var jsob = jQuery.parseJSON(strarr[0]); var divs = ''; $.each(jsob.Table, function(i, employee) { divs += '<div class="resultsdiv"><br /><span class="resultName">' + employee.Emp_Name + '</span><span class="resultfields" style="padding-left:100px;">Category&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.Desig_Name + '</span><br /><br /><span id="SalaryBasis" class="resultfields">Salary Basis&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.SalaryBasis + '</span><span class="resultfields" style="padding-left:25px;">Salary&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.FixedSalary + '</span><span style="font-size:110%;font-weight:bolder;padding-left:25px;">Address&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.Address + '</span></div>'; }); $("#ResultsDiv").append(divs).show('slow'); $(".pager").pagination(strarr[1], { // callback function call to this method current_page: curPage-1, items_per_page: '5', num_display_entries : '5', next_text: 'Next', prev_text: 'Prev', num_edge_entries: '1' }); } }); } On the initial page load i get all divs with page numbers generated but when i click the next page number nothing happens because callback is not configured....Because my callback function has to call the same method with the current anchor tag which is clicked... Any suggestion how to get this done.......

    Read the article

  • How can I layout a sidebar or pullquote?

    - by Rich
    I have 4 divs in a fixed width layout: a, b, c, and d, and they are ordered in the html like this: <div id="a"> </div> <div id="b"> </div> <div id="c"> </div> <div id="d"> </div> Using CSS, I want them to be laid out with divs a, b, and d in a vertical column, and div c to the right of and top-aligned with div b, like this: aaa aaa aaa bbbccc bbbccc bbbccc ddd ddd ddd I need this layout to work even though the divs contain unknown content, and so could be of varying length: aaa aaa aaa bbbccc bbbccc dddccc dddccc ddd or: aaa aaa aaa bbbccc bbb bbb ddd ddd ddd or even (if possible): aaa aaa bbbccc dddccc eeeccc eee I can't simply float div c to the right and then move it up, because, without using Javascript, I don't know the height of div b, and so don't know how much to move it up by. Is this possible in HTML and CSS, without reordering the divs?

    Read the article

  • Internet Explorer 6 and 7: floated elements expand to 100% width when they contain a child element f

    - by Paul D. Waite
    I've got a parent div floated left, with two child divs that I need to float right. The parent div should (if I understand the spec correctly) be as wide as needed to contain the child divs, and this is how it behaves in Firefox et al. In IE, the parent div expands to 100% width. This seems to be an issue with floated elements that have children floated right. Test page: <!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" lang="en" xml:lang="en"> <head> <title>Float test</title> </head> <body> <div style="border-top:solid 10px #0c0;float:left;"> <div style="border-top:solid 10px #00c;float:right;">Tester 1</div> <div style="border-top:solid 10px #c0c;float:right;">Tester 2</div> </div> </body> </html> Unfortunately I can't fix the width of the child divs, so I can't set a fixed width on the parent. Is there a CSS-only workaround to make the parent div as wide as the child divs?

    Read the article

  • jQuery Select Menu Replacement

    - by Brad
    I have a select drop-down that selects a theme for the current page the user is on: <select id="style" name="acct-stylenum"> <option value="1" selected="true">Light</option> <option value="2">Dark</option> </select> Now what I would like to do is add two divs that will also control this select menu. I would much rather have the user select between two images than a select menu. The divs are as follows: <div class="style-box light"></div> <div class="style-box dark"></div> I would like to use jQuery to make the select menu hidden but still use its input. Also I would like the divs to control the menus value and show a selected state. Please let me know the easiest way this can be done using jQuery or JavaScript. Thanks in advance. -B

    Read the article

  • how do I select a div with class "A" but NOT with class "B"?

    - by MedicineMan
    I have some divs: <div class="A">"Target"</div> <div class="A B">"NotMyTarget"</div> <div class="A C">"NotMyTarget"</div> <div class="A D">"NotMyTarget"</div> <div class="A E">"NotMyTarget"</div> Is there a CSS selector that will get me the div containing Target but not the divs containing NotMyTarget? Solution must work on IE7, IE8, Safari, Chrome, and Firefox Edit: So far Nick is the closest. It's clumsy and I don't like the solution, but at least it works: .A { style that all divs will take } div.B { style that will override style .A }

    Read the article

  • how to set the background image property of a div to a dynamically generated image

    - by tixrus
    I have some divs and each one has its own background image. The base images as stored is just a black silhouette. What I would like to do is use the PHP GD package to modify the color of those images somewhat randomly and have the modified randomly coloured images be the background images of the divs. One way to do it is just create GD images structures from the original files, modify them, save the results as a temp file, pass this filename into the client, and then use jquery to modify the css background image properties of the divs to be the new file. But this is going to leave a lot of files laying around to garbage collect. Is there some way to do it without creating a bunch of files?

    Read the article

  • How to stop IE8 from expanding a nested div's width to fit parent div?

    - by Tony_Henrich
    I have a page with several levels of divs. In one of the inner divs, there are two divs (1 & 2) which have float; left so that they are on the same horizontal level. It looks good in FireFox, but in the IE8, div 2 is below div 1. I turned the borders on and noticed div2 (violet border) is filling the width of the parent box. In FF, the width is the width of all the content only. If I use a hard coded width (not a good idea), IE8 displays it fine. How can I make IE8 not expand the width of div2 to the right edge of its parent div? IE8 (not good: div2 width is expanded) Firefox (good: width of div2 is not expanded)

    Read the article

  • Why are web developers so keen to use lists ?

    - by Bob
    I've been developing for a while and often develop sites using menu tabs. And I can't figure out why so many web developers like using lists < ul < li etc rather than just using plain old divs. I can make menus in divs which are simple and work perfectly in every browser. With lists, I'm usually trying to hack it one way or another to get it work properly. So my question is simple : why should I use lists to create my menus instead of divs ?

    Read the article

  • Toggling doesnt work inIE 7

    - by praveen
    I have two divs i need to perform toggling between two divs while doing this some of the divs in my main div are not displaying none ie7 unction initMakeAPost() { $('questionheaderid').hide(); //hiding the questions section $('MP_questionofday_txtboxid').hide();//hiding the questions answer"textbox and button" section $('recaspotheaderid').hide();//hiding the search by txtspotname and city-spots //$('footer_userpost').hide();//hiding the footer $('makeapostid').show();//show the make a post content $('btnQAPost').hide(); $('footer_userpost').hide();//Vamsi:Hiding the footer intitially $('sreetCredContainer').hide(); $('postbtnid_dead').hide(); $('askNextQuestion').hide(); //$('UploadImgContainer').show();// for upload } evn if i hide it doesnt hide in IE7

    Read the article

  • looping through new div as they are created

    - by eknown
    I have a div, let's call it class="phoneNo". Inside the div there are two links, one to add another div just like it, and another to delete the div itself. I'm trying to create a loop where if there's only 1 of these divs, the "delete" link should hide, and if there are more than 1 of these divs, the "delete" link should show up on all the divs. So far I came up with this, but no success: var pCount = $(".phoneNo").length; $(pCount).each(function(){ if (pCount <= 1) { $("a.deleteThis").hide(); } else if (pCount >= 1) { $("a.deleteThis").show(); } return true; });

    Read the article

  • Toggling doesn't work in IE 7

    - by praveen
    I have two divs i need to perform toggling between two divs while doing this some of the divs in my main div are displaying even if i use hide() function this happens only in ie7 function initMakeAPost() { $('questionheaderid').hide(); //hiding the questions section $('MP_questionofday_txtboxid').hide();//hiding the questions answer"textbox and button" section $('recaspotheaderid').hide();//hiding the search by txtspotname and city-spots //$('footer_userpost').hide();//hiding the footer $('makeapostid').show();//show the make a post content $('btnQAPost').hide(); $('footer_userpost').hide(); $('sreetCredContainer').hide(); $('postbtnid_dead').hide(); $('askNextQuestion').hide(); //$('UploadImgContainer').show();// for upload }

    Read the article

  • Slide Effect happening too many times

    - by Abs
    Hello all, I call this functions on onmouseover and onmouseout for several divs. //Takes effect on divs with id, 62,63,64,65... function slide_it(id){ $('#options_'+id).slideToggle('slow'); } The problem is that if I move my mouse over and then mouse out, then again, mouse over and then mouse out. If I do this several times, the slide effect happens the same number of times I moved my mouse over and out of the div, as expected. But I can't figure out how I can do this once? I can set a variable, but I have several divs that this function is used by and I can't think of a simple way of doing this rather than storing things into an array, but this is messy! I really appreciate any help on this that is simple to implement! Thanks all for any help

    Read the article

  • Is there a better way to have a two column website with header and footer, equal height columns and stretchy column widths? [closed]

    - by Seamus
    I wrote a website a while ago that is a little messy in how it does things. I used this CSS template and this equal height columns trick. I have not one but two container divs and I can't remember what they're doing. So I'm thinking of re structuring the thing from scratch, and possibly making use of the more "semantic" html5 tags like <nav> and so on at the same time. The question is: is there a better way to achieve a site structure with these properties: 2 equal height main columns (with widths as percentages of the available real estate, not explicitly stated) both a header and footer element that stretch the whole width of the total of the two main columns That allows the use of semantic html5 tags instead of meaningless divs

    Read the article

  • problem with template: negative margins on float

    - by Fuxi
    hi, i'm having a very strange problem with the wordpress template. i'd like to place 2 divs besides each other like this: <div style='float:left;'> left div </div> <div style='float:right'> right div </div> normally this works as it should - both divs should stick directly to each other - but something in the style.css (which uses css reset) causes the right div to overlap the left div with ~ 5pixels. i searched the whole .css for it but couldn't find out :(( it's just a fact that it must be something with the default css. anyone knows what is causing this - some fix? thanks

    Read the article

  • problem with template: negative margins on float

    - by Fuxi
    i'm having a very strange problem with the wordpress template. i'd like to place 2 divs besides each other like this: <div style='float:left;'> left div </div> <div style='float:right'> right div </div> normally this works as it should - both divs should stick directly to each other - but something in the style.css (which uses css reset) causes the right div to overlap the left div with ~ 5pixels. i searched the whole .css for it but couldn't find out :(( it's just a fact that it must be something with the default css. anyone knows what is causing this - some fix? thanks

    Read the article

  • jquery mouse events masked by img in IE8 - all other platforms/browsers work fine

    - by Bruce
    Using the jQuery mouse events for mouseenter, mouseleave or hover all work swimmingly on all Mac or Windows browsers except for IE8/Windows. I am using mouseenter and mouseleave to test for hot rectangles (absolutely positioned and dimensioned divs that have no content) over an image used as hotspots to make visible the navigation buttons when different regions of the main enclosing rectangle (image) are touched by the cursor. Windows/IE jQuery never sends notifications (mouseenter our mouseleave) as the cursor enters or exits one of the target divs. If I turn off the visibility of the image everything works as expected (like it does in every other browser), so the image is effectively blocking all messages (the intention was for the image to be a background and all the divs float above it, where they can be clicked on). I understand that there's a z-index gotcha (so explicitly specifying z-index for each absolute positioned div does not work), but unclear as to how to nest or order multiple divs to allow a single set of jQuery rules to support all browsers. The image tag seems to trump all other divs and always appear in front of them... BTW: I could not use i m g as a tag in this text so it is spelled image in the following, so the input editor does not think that I am trying to pull a fast one on stackoverflow... How used? "mainview" is the background image, "zoneleft" and "zoneright" are the active areas where when the cursor enters the nav buttons "leftarrow" and rightarrow" are supposed to appear. Javascript $("div#zoneleft").bind("mouseenter",function () // enters left zone see left arrow { arrowVisibility("left"); document.getElementById("leftarrow").style.display="block"; }).bind("mouseleave",function () { document.getElementById("leftarrow").style.visibility="hidden"; document.getElementById("rightarrow").style.visibility="hidden"; }); HTML <div id="zoneleft" style="position:absolute; top:44px; left:0px; width:355px; height:372px; z-index:40;"> <div id="leftarrow" style="position:absolute; top:158px; left:0px; z-index:50;"><img src="images/newleft.png" width="59" height="56"/></div></div> <div id="zoneright" style="position:absolute; top:44px; left:355px; width:355px; height:372px; z-index:40;"> <div id="rightarrow" style="position:absolute; top:158px; left:296px; z-index:50;"> (tag named changed so that I could include it here) <image src="images/newright.png" width="59" height="56" /></div></div> </div><!-- navbuttons --> <image id="mainview" style="z-index:-1;" src="images/projectPhotos/photo1.jpg" width:710px; height:372px; /> (tag named changed so that I could include it here) </div><!--photo-->

    Read the article

  • click events issue in jquery.

    - by alex
    I don't know if the title explain this situation well. Below is a code i wrote to create div elements when the button is pressed. Then By clicking on any of the created divs, we can change the div background by choosing a color from the drop down box. However if i click on another div and tried to change the color by selecting another color from the drop down, the previously clicked divs also gets affected by the new color. Why is this happening. I only want the selected div to change color, without affecting the previously clicked divs. I read allot of threads on this site, some of which talks about unbinding clicks, but I'm unable to solve the problem. Thanks for the help. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <style> .aaa { width:100px; height:100px;background-color:#ccc;margin-bottom:5px;} p{widht:500px; height:500px; margin:0px; padding:0px;border:2px solid red;color:#000;} </style> <select id="item_select" name="item"> <option value="1">red</option> <option value="2">blue</option> <option value="3">green</option> </select> <button>Click to create divs</button> <p id="ptest"></p> <script type="text/javascript"> var dividcount = 1; $("button").click(run); function run(){ var myDiv = $('<div id=lar'+dividcount+' class=aaa></div>'); $(myDiv).clone().appendTo('#ptest'); $(dividcount++); $("div").bind('click',(function() { var box = $("div").index(this); var idd = (this.id); $("#"+idd).text("div #"+idd); $("select").change(function(){ var str= $("select option:selected").text(); $("#"+idd).css("background-color",str); }); })); }; </script>

    Read the article

  • How to auto apply drag and drop effect to dynamically added element ?

    - by Relax
    I use jquery ui to apply a drag and drop effect on a serial of DIVs, for example: <div class="draggable">...</div> <div class="draggable">...</div> <div class="draggable">...</div> <div class="draggable"> this DIV was dynamically added, not draggable </div> The problem is dynamically added DIVs won't have this effect applied, how can i apply this effect on new members too?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >