Search Results

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

Page 4/46 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Display X divs randomly out of a possible Y.

    - by Jordan
    How do I randomly display 3 divs out of a possible 10 in total? This is what I have tried so far: HTML: <div id="1">Content 1</div> <div id="2">Content 2</div> <div id="3">Content 3</div> <div id="4">Content 4</div> <div id="5">Content 5</div> <div id="6">Content 6</div> Javascript: function randomiseDiv() { // Define how many divs we have var divCount = 6; // Get our random ID (based on the total above) var randomId = Math.floor(Math.random()*divCount+1); // Get the div that's been randomly selectted var chosenDiv= document.getElementById(randomId); // If the content is available on the page if (chosenDiv) { // Update the display chosenDiv.style.display = 'block'; } } window.onload = randomiseDiv; I would prefer a PHP solution, although anything at this stage would be beneficial.

    Read the article

  • Moving Multiple Divs With Same Class Inside Parent

    - by superzilla
    So, My website is hosted on enjin.com and when you give users a tag with an image it appears on the forums under their name, however it's a vertical list with the tag names. I want to organize it so all of the tag images appear on one line and all of the tag names appear on a horizontal list below it. They use div tags somewhat like this <div class="tag"> <div class="tag-image"></div> <!-- If the tag lacks an image this is excluded --> <div class="tag-text">Tag Name</div> <!-- If you want the name to be hidden this is excluded --> </div> They then pretty much repeat this for every tag. Somewhat the same thing is used for forum posts too. So, I want to move all the tag-image divs together on a single line and all of the tag-text divs down and give each it's own line. I only want to move them within their parent element (to avoid images/tags from one forum user from going to another). I know how to append things with jquery and have googled how to move elements around, but I'm afraid that they're all going to end up together under another user's avatar.

    Read the article

  • Show/Hide divs with same class - jquery

    - by phil
    Hello, I have 1 div that will contain 3-5 divs with the same class. Below the div is an anchor. I would like for when this anchor is clicked it will hide the first div and then show the second. Another click would show the next and so on. I have set display:none on all divs but the first so only one is currently showing. I just can't figure out how to hide the first and then show the second, then third, then next when clicking the anchor. <div class="container-div"> <div class="inner-div">...</div> <div class="inner-div" style="display:none;">...</div> <div class="inner-div" style="display:none;">...</div> <a href="#" class="more">More</a> </div> So when the more anchor is clicked it would show one inner-div one at a time. Any suggestions or ideas would be greatly appreciated. Also, I would like to use jquery to accomplish this.

    Read the article

  • Multi-Page invoice printing on one page

    - by ryan
    I have an invoice that contains over 100 lines of product that I am trying to print. This single invoice should take over 3 pages, but when printed, the content flows off the footer and the next page is the following invoice. I am using divs instead of tables, and I can't understand why the long invoices will not print on multiple pages. Any ideas?

    Read the article

  • HTML email: tables or divs?

    - by j-man86
    Does the HTML/CSS for an html email newsletter need to be in table format, or can I use DIVs with equal assurance it will display well cross email-client? I've downloaded a number of templates to see how they're done, upon which to base my own, and they all seem to use tables. Any insight much appreciated, thanks!

    Read the article

  • Blueprint CSS overlapping divs

    - by Chetan
    I'm using the Blueprint CSS framework, and I want to know how to create overlapping divs. If I try to use an absolutely positioned div inside of a relatively positioned div, it messes up the rest of the styling of the div by Blueprint. What is the correct way to do this?

    Read the article

  • Trying to use contains selector within nested divs

    - by James
    <div> <div>test</div> </div> $("div:contains('test')").css('display','none'); I know I am going to kick myself on this. The problem is that when this runs all divs are hidden due to nesting. How do I make it so that the parent div does not get hidden? I am limited to using 1.2.6

    Read the article

  • extremely small gap between two divs that are width 100%

    - by Naomi K
    hi I have two container divs one of them has a div with an image background and i think this is the div that is causing problem. I tried removing both container divs and the gap was still here. there are no margins no paddings, and i know it is not the image that has this line its not there when i open it in photoshop. I am also using css reset Where is this space coming from? css .container{ width:100%; } .container2{ width:100%; } .first-image{ width:1430px; height:497px; background-image:url('../images/introimg.jpg'); background-repeat:no-repeat; background-size: 100%; border:none; } .jamey{ width:35%; } .second-image{ width:1430px; height:430px; background-image:url('../images/secondimg.jpg'); background-repeat:no-repeat; background-size: 100%; } html <div class="container"> <div class="wrapper"> <div id="overlay"></div> <div class="first-image"> <div class="jamey"> <p class="def"> JAMEY </p> <p class="rip-date">03.02.1997 - 09.18.2011</p> <p class="def2">Anonymous hate messages were posted on his Formspring account including one that claimed:</p> </div> </div> </div> </div> <div class="container2"> <div class="intro-div"> <div class="end-hate"> <h1>PUT AN END TO HATE.</h1> <p> ANYTHING WRITTEN ONLINE can become viral </p> <p> We believe that the way we behave online should be no different from the way that we behave in </p> <button type="button">JOIN CAMPAIGN</button> </div> </div>

    Read the article

  • CSS two divs next to each other

    - by Martijn
    Hi, I want to put two divs next to each other. The right div is about 200px; en the div left must fill up the rest of the screen width? How can i do this? I don't want to use percents because then my layout is crap :) Thnx

    Read the article

  • converting nested DIVs into CSV format....

    - by wefwgeweg
    okay there is already solutions for finding TABLE, LIST and converting that to CSV however, what about DIVs ? there are some sites that use DIV + CSS to display data.... i am using nokogiri, i wonder how will i be able to automatically find nested DIV, and convert it to CSV format ?

    Read the article

  • jQuery: Sort div's according to content of different sub divs

    - by rayne
    I'm trying to create a somewhat complex sorting feature which neither uses divs nor lists. Unfortunately two hours of googling didn't help me. Here is the basic setup of my HTML: <div id="all_elements"> <!-- one element --> <div class="element"> <div class="wrapper"> <a href="/" title="links"> <img src="/img/image.jpg" border="0" alt="image" class="image" /></a> <div class="details"> <h3><a href="/" title="title">Name (Sort Argument 1)</a></h3> <div class="title"><a href="/" title="title">Title (Sort Argument 2)</a></div> <div class="year">2010 (Sort Argumentt 3)</div> <div class="country">Great Britain (Sort Argument 4)</div> </div><!-- details --> </div><!-- wrapper --> </div><!-- element --> </div> <!--all_elements--> The setup is a bit complex, but basically .element is the element that needs to be sorted alphabetically according to either the contents of h3, div.title, div.year or div.country. So the user will be able to view the contents of the site either sorted by name, by year, by country or by title. I have this jQuery snippet from a website, but all my attempts on trying to tell it to use the contents of e.g. h3 to sort have failed. Right now it sorts pretty much randomly. jQuery.fn.sort = function() { return this.pushStack([].sort.apply(this, arguments), []); }; function sortAscending(a, b) { return a.innerHTML > b.innerHTML ? 1 : -1; }; function sortDescending(a, b) { return a.innerHTML < b.innerHTML ? 1 : -1; }; $(document).ready(function() { $("#sort").toggle( function() { $('#all_elements .element').sort(sortDescending).appendTo('#all_elements'); $(this).text("Sort Asc"); }, function() { $('#all_elements .element').sort(sortAscending).appendTo('#all_elements'); $(this).text("Sort Desc"); }); }); How can I customize the function to sort the contents of my h3 or divs?

    Read the article

  • IE8 Randomly does not show background images of my divs

    - by ace
    I have this annoying problem driving me nuts, IE 8 randomly won't show background images of my divs. One minute it shows, then the next time it won't. Then I have to refresh the page 2-3 times for it to show. All my pages work fine on firefox, chrome. Has anyone faced a similar problem? Any solutions?

    Read the article

  • dropdown hidden behind divs in IE7

    - by morktron
    Hi I've finally got Suckerfish working and styled but in IE7 it is hidden behind the divs below it. See the dropdown on the 'Your Video/Pics' button here. I know usually a z-index would solve the issue but in this case it seems not. Can anyone help? Don't worry this site is not supposed to work in IE6 ;)

    Read the article

  • Problems with JQuery's Droppable Tolerance 'fit' feature when using the same size divs

    - by Chris
    Hi I'm just wondering if anybody else can manage to get the tolerance:'fit' option to work when using the 'droppable' feature in jQuery's UI? I want to call a function only when the draggable div is dropped perfectly onto a droppable div. Both divs are the same size and I'm using snapMode:outer to help the end user. I simply cannot get it to work with 'fit'. Works perfectly with 'intersect'. Would really appreciate some help. Thanks Chris

    Read the article

  • HTML: Menus as UL instead of DIVs?

    - by JamesBrownIsDead
    I recently created a menu for a web page where buttons are DIV elements. I've been Googling around and see that many people create UL lists and each button is a LI element. What benefit is using an UL and LIs instead of just DIVs? Is it somehow better for SEO? Does this have to do with "semantic" markup? Any compelling reason to rewrite my menu as a UL?

    Read the article

  • CSS Collapsing/Hiding divs with no data in <span>

    - by Chance
    I am trying to display an address which includes the following information: Title, division, address1, address2, town/state/zip, and country (5 seperate lines worth of data). The problem is sometimes the company may only have the title, address1, and town/state/zip yet other times it may be all but address2. This is determined upon a db record request server side. Therefore how can I make my output look proper when some of my labels will be blank? I would like div's that contain an empty span to be essentially collapsed/removed. My only idea of how was to use jquery and a selector to find all divs with blank spans (since thats all an asp.net label really is) and then remove those divs however this seems like such bad form. Is there any way to do this with css? Possible Code would be something like: $('span:empty:only-child').parent('div').remove(); Picture Examples (Ignore spacing/indentation issues which I will fix) Missing Division, Address2, and Country All Possible Fields The Html <asp:Label runat="server" ID="lblBillingAddressHeader" CssClass="lblBillingAddressHeader" Text="Billing Address:" /> <div style="position:relative; top:150px; left: 113px;"> <div class="test"> <asp:Label runat="server" ID="lblBillingDivision" CssClass="lblBillingShippingDivisionFont" /> </div> <div class="test"> <asp:Label runat="server" ID="lblBillingAddress" CssClass="lblBillingShippingFont" /> </div> <div class="test"> <asp:Label runat="server" ID="lblBillingAddress2" CssClass="lblBillingShippingFont" /> </div> <div class="test"> <asp:Label runat="server" ID="lblBillingAddress3" CssClass="lblBillingShippingFont" /> </div> <div class="test"> <asp:Label runat="server" ID="lblBillingAddress4" CssClass="lblBillingShippingFont" /> </div> </div> The CSS .test { position: relative; top: 0px; left: 0px; height: 12px; width: 300px; } .lblBillingShippingDivisionFont { font-size: small; font-weight: bold; } .lblBillingShippingFont { font-size: 10.6px; }

    Read the article

  • jQuery to hide and show divs with an indicator

    - by songdogtech
    Using the jQuery below to toggle the hiding and showing of divs of text: how would I add some sort of indicator - like an up and down arrow as a graphic - to the titles when the divs are either open and closed? What's the best way to do that? Two images? A CSS sprite? And most importantly: how would that be integrated into the JS? I've looked at other jQuery that assigns a random number to each div and then determines which are open and which are closed and toggles one of two images. But I'm using php in a WordPress loop to show a posts, and that gives problems with incrementing in the loop, so there must be an easier way that doesn't require changes in the name of the title div. Thanks.... This JS fires the showing and hiding. Each div can be expanded and collapsed independently. $(document).ready(function() { $('div.demo-show:eq(0)> div').hide(); $('div.demo-show:eq(0)> h3').click(function() { $(this).next().slideToggle('fast'); }); }); This is the HTML it works with: <div class="collapser"> <p class="title">Header-1 </p> <div class="contents">Lorem ipsum</div> <p class="title">Header-2</p> <div class="contents">Lorem ipsum </div> <p class="title">Header-3</p> <div class="contents">Lorem ipsum</div> </div> The CSS is arbitrary: .collapser { margin: 0; padding: 0; width: 500px; } .title { margin: 1px; color: #fff; padding: 3px 10px; cursor: pointer; position: relative; background-color:#c30; } .contents { padding: 5px 10px; background-color:#fafafa; }

    Read the article

  • how to make DIV show up on top of other Divs

    - by feelexit
    I upload my code on jsFiddle, you can see it there. http://jsfiddle.net/SrT2U/2/ When you click on the link, the hidden FAQ section will show up, and it will push other divs down. But that is not what I want, I need all other divs stay where they are, and my hidden FAQ section just float on the top. Not sure how to do it. Not even sure if this should be done in HTML, CSS or jQuery. My jQuery code: $(function(){ $(".OpenTopMessage").click(function () { $("#details").slideToggle("slow"); }); }); HTML code: <div style="border: 1px solid #000;"> <span>link</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <span>link</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <span>link</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <span>link</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <span>link</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> </div> <div id="faqBox"> <table width="100%"> <tr><td><a href="#" id="openFAQ" class="OpenTopMessage">this is hte faq section</a></td> </tr> </table> <div id="details" style="display:none"> <br/><br/><br/><br/><br/><br/><br/><br/> the display style property is set to none to ensure that the element no longer affects the layout of the page <br/><br/><br/><br/><br/><br/><br/><br/> </div> </div> <br/><br/> <div style="background:#c00;">other stuff heren the height reaches 0 after a hiding animation, the display style property is set to </div>

    Read the article

  • Jquery to max number from a set of divs

    - by Matias
    Guys, Given the following HTML <div class"myclass">10</div> <div class"myclass">25</div> <div class"myclass">50</div> <div class"myclass">20</div> I want Jquery to return the maximum value found on divs with class:"myclass". (This is 50) I thought of using .find.text() will be a good starting point but cant figure out exactly how, Help is greatly appreciatted, Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >