Search Results

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

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

  • SPAN vs DIV (inline-block)

    - by blackjid
    Hi, Is there any reason to use a <div style="display:inline-block"> instead of a <span> to layout a webpage? Can I put content nested inside the span? What is valid and what isn't? Thanks! It's ok to use this to make a 3x2 table like layout? <div> <span> content1(divs,p, spans, etc) </span> <span> content2(divs,p, spans, etc) </span> <span> content3(divs,p, spans, etc) </span> </div> <div> <span> content4(divs,p, spans, etc) </span> <span> content5(divs,p, spans, etc) </span> <span> content6(divs,p, spans, etc) </span> </div>

    Read the article

  • SIFR, JAVASCRIPT & PHP - How to apply SIFR to dynamically loaded content.

    - by user311039
    Well here's the problem: I have a PHP index page which uses show/hide layers javascript. I am using the on menu.click function to show and hide content relevant to each menu. On.click all divs are hidden except the content for that menu item , which fades in. The content relating to each menu item are displayed within separate DIVS. The property is applied to all the text within all the divs. See: http://jobe-group.com/jobeco/uk/2010live/dynamic/content/index.php# The trouble is that SIFR only appears to be applied to the displayed on.load when the page is first loaded. When this is hidden and the other s shown through the "show" function they load in classic CSS fonts without the SIFR applied. Is this unavoidable with the SIFR setup. Or am I not calling the divs properly. I have set the SIFR to apply to the selector and indeed it works fine on the for the displayed on load. It doesn't work for the within other . In theory I would think its possible to load the SIFR on all divs on page.load even if those divs are presently visibility:hidden. What's the verdict on this? Hope someone can help. Cheers, John

    Read the article

  • How make this jquery function reusable?

    - by Pandiya Chendur
    Comsider this jquery function, function showresults(jsonobj) { $.each(jsonobj, function(i, employee) { divs += '<div class="resultsdiv"><br /><span style="display: inline-block;width:150px;" 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>'; }); } Here i am iterating my json data and drawing div elements.... As you see these div elements are hardcoded how to pass these html div elements dynamically by a variable... var divs=<div></div> function showresults(jsonobj,divs) { $.each(jsonobj, function(i, employee) { divs += divs Is this correct way of doing but there will be an error employee object wont be there know when my divs variable declared outside the function... Any suggestion...

    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

  • Add to extra div to the side of the content

    - by Kreker
    Hi. I've read some post for adding extra divs to the both sides of the main content and act like a sidebars. But I want to add 2 extra div for adding some graphics and the right will be to the right of the actual sidebar. I took a screenshot for explain my self better. I've added to extra div before the pagewrap and working with css I locate the divs to left and to the right but there is a problem, if some has a resolution smaller then me the divs start moving messing up the loyout. I want that they stay near the content and the sidebar for all the resolution. I've tryed working with css with position and % but with no results. Ok so, the cyan rectangle would be the extra divs, and the gray graphics the contents of these. I don't care if the users has smaller resolutions, the graphics can go out the screen, but the "roots" must be fixed to the side of the main content ;) Hope I explained well. This is the screenshot http://cl.ly/0D2H1s0t3Y0p2A412L35/Schermata-2011-01-11-a-22.22.17.png Thanks for help

    Read the article

  • Does watir's browser.text.include? count text inside invisible divs? If so, how to search only for v

    - by karlthorwald
    Does watir's browser.text.include? count text inside invisible divs? If so, how to search only for visible text? I put all the instructions into the html from the beginning and use jQuery to hide and unhide the relevant parts. How can I use watir's waiter to wait for only text that is visible? My problem is, that the waiter always returns true, even before I have shown a certain text.

    Read the article

  • Scale DIV with tiles

    - by user15350
    I am trying to create a repeating background. I have a main DIV with a grid of small 16x16 DIVs. I am trying to scale the main DIV in CSS; when the small DIVs simply have a red background color everything works great, but when there is a background image in the small DIVs then borders become visible between the tiles. This image explains the problem: http://cl.ly/FpNW/o Check the HTML in these examples: With BG-COLOR: http://jsfiddle.net/pTLXw/ With BG-IMG: http://jsfiddle.net/vkpuY/ Does anyone know what is causing this problem and how to fix it? If it is not possible to fix while using DIV, is there another way to do this? Thanks you so much!

    Read the article

  • In a browser, is it best to use one huge spritesheet or many (10000) different PNG's?

    - by Nick
    I'm creating a game in jQuery, where I use about 10000 32x32 tiles. Until now, I have been using them all separately (no sprite sheet). An average map uses about 2000 tiles (sometimes re-used PNG's but all separate divs) and the performance ranges from stable (Chrome) to a bit laggy (Firefox). Each of these divs are positioned absolutely using CSS. They do not need to be updated every tick, just when a new map is loaded. Would it be better for performance to use spritesheet methods for the divs using CSS background-positioning, like gameQuery does? Thank you in advance!

    Read the article

  • jquery finish one animation then start the other one

    - by Emin
    I have one two divs and two seperate links that triggers slideDown and slideUp for the divs. When one of the divs are slided down and I click the other one, I hide the first div (slidingUp) and then open the other div (slidingDown) but, at the moment its like while one div is sliding down, the other, also in the same time, is sliding up. is there a way that would tell jquery to wait to finish sliding down of one div and only then start sliding up the other ?

    Read the article

  • Ruby page loading very very slowly - how should I speed it up?

    - by Elliot
    Hey guys, I'm going to try and describe the code in my view, without actually posting all the garbage: It has a standard shell (header, footer etc. in the layout) this is also where the sub navigation exists which is based on a loop (to find the amount of options) - on this page, we have 6 subnav links. Then in the index view, we have a 3rd level nav - with 3 links that use javascript to link/hide divs on the page. This means each of those original 6 options, all have their own 3'rd level nav, with each of their own 3 div pages. These three pages/divs have the input form for creating a record in rails, and then the other 2 pages show the records in different assortments. ALL of this code lives on one page (aside from the shell). The original sub nav uses a javascript tab solution, to browse through all of it... (this means its about 6 divs, which all contain 4 divs of function - so about 24 heavy divs). Loading it seems to take forever, although after loaded its extremely fast (obviously). My big question, is how should I attack this? I don't know ajax - although I imagine it'd be a good solution for loading the tabs when clicked. Thanks! Elliot

    Read the article

  • HTML/CSS Div placing

    - by Andreas Carlbom
    Yo. There's a tendency in placing divs to follow each other vertically, but what i'm trying to accomplish right now is to is basically to place a number of divs (two) inside a parent div like so: <div id='parent'><div id='onediv'></div> <div id='anotherone'></div> </div> And i'd like to place 'anotherone' just to the right of 'onediv'. Sadly, float:right is pretty much ruining the layout with the divs popping out of their parent divs and whatnot. Any suggestions are welcome. Edit: It might be worth noting that the parent div and 'anotherone' has no height elements at all, with 'onediv' planned to be thought as the "height support" div, allowing the contents of 'anotherone' to make the parent div larger at will.

    Read the article

  • difference between calling javascript function on body load or directly from script.

    - by Abbas
    i am using a javascript where in i am creating multiple div (say 5) at runtime, using javascript function, all the divs contain some text, which is again set at runtime, now i want to disable all the divs at runtime and have the page numbers in the bottom, so that whenever user clicks on the page number only that div should get visible else other should get disable, i have created a function, which accepts parameter, as page number, i enable the div whose page number is clicked and using a for loop, i disable all the other divs, now here my problem is i have created two functions, 1st (for adding divs and disabling all the divs except 1st) and writing content to it, and other for enabling the div whose page number is clicked, and i have called the Adding div function on body onload; now first time when i run, page everthing goes well, but next time when i click on any of the page number, it just gets enabled and again that AddDiv function, runs and re-enables all the divs.. Please reply why this is happening and how should i resolve my issue... Below is my script, content for the div are coming using Json. <body onload="JsonScript();"> <script language="javascript" type="text/javascript"> function JsonScript() { var existingDiv = document.getElementById("form1"); var newAnchorDiv = document.createElement("div"); newAnchorDiv.id = "anchorDiv"; var list = { "Article": articleList }; for(var i=0; i < list.Article.length; i++) { var newDiv = document.createElement("div"); newDiv.id = "div"+(i+1); newDiv.innerHTML = list.Article[i].toString(); newAnchorDiv.innerHTML += "<a href='' onclick='displayMessage("+(i+1)+")'>"+(i+1)+"</a>&nbsp;"; existingDiv.appendChild(newDiv); existingDiv.appendChild(newAnchorDiv); } for(var j = 2; j < list.Article.length + 1; j ++) { var getDivs = document.getElementById("div"+j); getDivs.style.display = "none"; } } function displayMessage(currentId) { var list = {"Article" : articleList} document.getElementById("div"+currentId).style.display = 'block'; for(var i = 1; i < list.Article.length + 1; i++) { if (i != currentId) { document.getElementById("div"+i).style.display = 'none'; } } } </script> Thanks and Regards

    Read the article

  • jquery array: find elements that appear twice in the array

    - by tsiger
    For a markup like this: <div id="set1"> <div id="100">a div</div> <div id="101">another div</div> <div id="102">another div 2</div> <div id="120">same div</div> </div> <div id="set2"> <div id="105">a different div> <div id="101">another div</div> <div id="110">more divs</div> <div id="120">same div</div> </div> As you can see both #set1 and #set2 contain 2 divs with the same id (101, 120). Is it possible somehow with jQuery to find the common elements and add a class to the divs in #set1 that have the same id with divs in #set2? In other words after the script run the above code would look like this: <div id="set1"> <div id="100">a div</div> <div id="101" class="added">another div</div> <div id="102">another div 2</div> <div id="120" class="added">same div</div> </div> <div id="set2"> <div id="105">a different div> <div id="101">another div</div> <div id="110">more divs</div> <div id="120">same div</div> </div>

    Read the article

  • Highlight DIV and dim the rest on mouseover

    - by Darren Sweeney
    I have a page full of DIVs which contain images. When I mouse over an image I can highlight it or add a shadow to accent it easily by adding class etc but is there a way to dim every other image instead. DIVs are loaded into DOM and I would like the DIV currently hovered over to retain 100% or 1 opacity and the rest of the DIVs on the page to fade to say 70% or 0.7 when one DIV is highlighted. Is this possible?

    Read the article

  • Is it really best to make site without using <div>, using semantic tags only?

    - by jitendra
    I found this on net in google search and see article here: http://www.thatcssguy.com/limit-your-divs/ See his final layout here: http://www.nodivs.com/ Some quotes from article 1 When I limited the use of my divs all the major browser including both IE6 and IE7 would render the sites nearly perfectly. Or with very little fixes needed. 2 it’s magic but proves divs nor tables are necessary for layout Should we try to make sites like this?

    Read the article

  • Not responding to events?

    - by Legend
    I currently have three Divs and only one of them is in focus at a given time. All of them line up in a film strip fashion. When I click a DIV not in focus, the current one moves to the left or right (depending on the direction) and the new one comes into focus. The divs can have content that has links. So my problem is that upon clicking on the divs not in focus, if I happen to click on a link, the event is captured. Is there anyway I can disable event detection for divs not in focus? What I am looking for is something like: if(div not in focus) disable all links if (div comes into focus) enable all links

    Read the article

  • Node.js/Express Partials problem: Can't be nested too deep?

    - by heorling
    I'm learning Node.js, Express, haml.js and liking it. I've run into a prety annoying problem though. I'm pretty new to this but have been getting nice results so far. I'm writing a jquery heavy web app that relies on a table containing divs. The divs slide around, switch back and fourth and are resized etc to my hearts content. What I'm looking for a way to switch (template?) the divs. Since I've been building in express and mimicking the chat example it would make sense to use partials. The rub is that I've been using inexplicit divs in haml, held within a td. The divs are cunstructed as follows: %tr %td .class1.class2.class3.classetc Which has worked fine cross browser. Parsing the classes works great for the js code to pass arguments around, fetch values etc. What I'd like to be able to do is something like: %tr %td .class1.class2.class3.classetc %ul#messages != this.partial('message.html.haml', { collection: messages }) Any combination I've tried with this has failed however. And I might have tried them all. If I could put a partial into that div I'd probably be set. And you can nest them as long as you use #ids instead of .classes. But if you use more than one class it breaks! I think that's the most accurate way of summing it up. How do you do this? I've checked out various templating solutions like mu.js and micro template like by John Resig. I earlier checked out this thread on templating engines. It's very possible I'm making some fundamental mistake here, I'm new to this. What's a good way to do this?

    Read the article

  • Equal Height Columns with Cross-Browser CSS

    - by Frank Michael Kraft
    I want to have divs of the same height. http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks does not work for be because my divs have a border, and the method described assumes, that they have not. A jQuery solution I could not make work, because my divs resize late because of ajax and menu clicks and I can not find an event for this.

    Read the article

  • Change class of parent div if radio input checked

    - by xxstevenxo
    I've been searching and searching google for answers to my question but have been unsuccessful so far. I'm hoping one of you guys could give me some assistance. I have 10 divs with the class name "dividend" holding a table with the classname/id of "container" then two smaller tables inside that. Within the container table at the bottom is a hidden radio button with the name "page1". I wrote an onClcick for the container table so the user can select the whole table instead of the radio button, but not I'm trying to change the style of the selected container so the users know they have selected it. I have tried a few different methods and I'm able to change the style to the new class by just writing document.getElementById('container').className = 'selected'; But because all 10 divs share the same name it will only change the style of the first element it finds. So I tried writing this loop to check if there are any selected radios in the document then to change the else name the style as the default. I'm sure its something stupid but I'm pretty stumped atm.. Any help would be appreciated. Thanks. selected = function () { var divs = document.getElementByTagName('DIV'), div, tbl, rad, stat, i; for (i = 0; i < divs.length; i++) { div = divs.id; if (div == 'dividend') { tbl = div.getElementById('container'); rad = tbl.getElementByTagName('INPUT'); if (rad.checked = true) { tbl.className = 'selected'; } } } };

    Read the article

  • Javascript/Jquery Super Scrollorama Navigation Issues

    - by Rosencruez
    On a Wordpress site I am currently working on, my client wanted the different sections of the front page to slide up from the bottom and cover up the previous section, like a wipe or slide transition. Using super scrollorama found here: http://johnpolacek.github.com/superscrollorama/, I managed to achieve the desired result. Next, I needed to create a navigation menu on the front page only. I did so, and set anchors at various different points on the pages. I also used the scrollTo library for scolling animations when I click the nav menu links. However, there are a number of problems I have encountered: When at the top and I click "showcase", it brings me down to the showcase section, but the products section (the div right after it) is overlapping it. Other divs seems to have the same problem of the following divs overlapping the current one I can only navigate forwards. When I try to go backwards, it won't (except for "Home") I thought it might have something to do with the CSS "top" property of the divs, so I tried resetting them every time the click function kicked in, but it didn't work. So I removed it for the time being. Currently set the javascript to prevent the default action of scrolling to the anchors and instead setting it to scroll to the actual divs themselves. However, I'm still having the same issues. Here is the site I am currently working on: http://breathe.simalam.ca/ Here is the javascript for the scrolling: $(document).ready(function() { jQuery('.home-link').click(function(e){ e.preventDefault(); jQuery(window).scrollTo(0, 1000, {queue:true}); }); jQuery('.showcase-link').click(function(e){ e.preventDefault(); jQuery(window).scrollTo('#showcase_content', 1000, {queue:true}); }); jQuery('.products-link').click(function(e){ e.preventDefault(); jQuery(window).scrollTo('#products_content', 1000, {queue:true}); }); jQuery('.about-link').click(function(e){ e.preventDefault(); jQuery(window).scrollTo('#about_content', 1000, {queue:true}); }); jQuery('.locator-link').click(function(e){ e.preventDefault(); jQuery(window).scrollTo('#locator_content', 1000, {queue:true}); }); jQuery('.contact-link').click(function(e){ e.preventDefault(); jQuery(window).scrollTo('#contact_content', 1000, {queue:true}); }); }); scrollorama code: $(document).ready(function() { $('#wrapper').css('display','block'); var controller = $.superscrollorama(); var pinDur = 4000; /* set duration of pin scroll in pixels */ // create animation timeline for pinned element var pinAnimations = new TimelineLite(); pinAnimations .append([ TweenMax.to($('#showcase'), .5, {css:{top:0}}) ], .5) .append([ TweenMax.to($('#products'), .5, {css:{top:0}}) ], .5) .append([ TweenMax.to($('#about'), .5, {css:{top:0}}) ], .5) .append([ TweenMax.to($('#locator'), .5, {css:{top:0}}) ], .5) .append([ TweenMax.to($('#contact'), .5, {css:{top:0}}) ], .5) .append(TweenMax.to($('#pin-frame-unpin'), .5, {css:{top:'100px'}})); controller.pin($('#examples-pin'), pinDur, { anim:pinAnimations, onPin: function() { $('#examples-pin').css('height','100%'); }, onUnpin: function() { $('#examples-pin').css('height','2000px'); } }); }); All of the section divs are inside a parent div. The section divs all have a height, width, and top of 100%. The parent div containing all of these section divs are as follows: #examples-pin { position: relative; /* relative positioning for transitions to work? */ width: 101%; /* max width */ height: 2000px; /* height of 2000px for now */ overflow: hidden; /* hide the overflow for transitions to work */ margin-bottom: -200px; /* negative bottom margin */ }

    Read the article

  • Timing issue with jQuery and $(document).ready()

    - by ripper234
    I have the following code block code when the document is ready: $(document).ready(function() { createDivs(); // creates some divs with class 'foo'; // iterate $(".foo").each(function(index) { alert(index + " - " + $(this).text()); }); } I find that the "iterate" part misses the divs I created in the createDivs() method entirely! Is there some timing issue I'm not aware of? Why doesn't jquery see the divs that were just created?

    Read the article

  • It's 2012.. why do we still need hacks like Micro Clearfix to do simple things? [closed]

    - by user72245
    I'm just dipping back into front-end development again. I seriously can't believe we're at "HTML5" yet the most basic thing imaginable - horizontal floating DIVs, still requires crazy esoteric hacks to work correctly? http://nicolasgallagher.com/micro-clearfix-hack/ Like this... why is this necessary? Why can't browsers just grow up and handle 3 dynamically-sized DIVs floating horizontally in a container row?

    Read the article

  • How to fix width of DIV that contains floated elements?

    - by joe
    I have a DIV container with several inner DIVs layed out by floating them all left. The inner DIVs may change width on certain events, and the containing DIV adjusts accordingly. I use float:left in the container to keep it shrunk to the width of the inner divs. I use float:left in the inner divs so the layout is clean even when their contents change. The catch is that I want the DIV container width and height to remain constant, UNLESS a particular event causes a change to the inner widths. Conceptually I want to use float on the inners for the layout benefit, but then I want to "fix" them so they don't float around. So if the container is 700px wide, I want it to remain so even if the user narrows the browser window. I'd like the container, and it's internal DIVs to just be clipped by the browser window. I sense this can all be done nicely in CSS, I just can't quite figure out how. I'm not averse to adding another container if necessary... Since the only desired layout changes are event-based, I am also willing to use a bit of JS. But is this necessary? (And I'm still not sure I know what to modify: container dimensions? inner floatiness? other?) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style type="text/css"> #canvas { overflow:auto; /* for clearing floats */ } #container { float:left; /* so container shrinks around contained divs */ border:thin solid blue; } .inner { float:left; /* so inner elems line up nicely w/o saying fixed coords */ padding-top:8px; padding-bottom:4px; padding-left:80px; padding-right:80px; } #inner1 { background-color:#ffdddd; } #inner2 { background-color:#ddffdd; } #inner3 { background-color:#ddddff; } </style> </head> <body> <div id="canvas"> <div id="container"> <div id="inner1" class="inner"> inner 1 </div> <div id="inner2" class="inner"> inner 2 </div> <div id="inner3" class="inner"> inner 3 </div> </div> </div> cleared element </body> </html>

    Read the article

  • 3 column layout with css display table, with first row having multiple rows?

    - by Damainman
    I am working on a new website which: Has 3 columns - Each Column being a cell First column has 3 rows (Logo, Nav, icons) - Has a Div with display: table which wraps arround 3 divs with display:table-row. Other two columns only have 1 row. With the middle column being the content area. However since this is my first time using display:table, I am running into some things that aren't so clear to me. I was trying to avoid floating divs. If I need multiple rows with one cell in each row per column, do I embed each cell in a row or just create each row and not declare cells. I understand that browsers automatically create the missing elements but I want to make sure I do this properly to avoid any side effects that might occur due to the browser automatically creating the missing elements. Edit: I think my brain is just over worked, I guess I can accomplish this by just using 3 divs in the first column instead of using a nested table div with the rows. This just popped into my head.

    Read the article

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