Search Results

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

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

  • JavaScript Show/Hide as Filters to list of divs

    - by deconspray
    Looking to create Javascript that acts like a filter on a list of divs. For instance, here's the intended markup... <a href="#" onclick="">Filter Item 1</a> <a href="#" onclick="">Filter Item 2</a> <a href="#" onclick="">Filter Item 3</a> <a href="#" onclick="">Filter Item 4</a> <a href="#" onclick="">Filter Item 5</a> <div class="1">Item 1</div> <div class="1">Item 1</div> <div class="2">Item 2</div> <div class="3">Item 3</div> <div class="1">Item 1</div> <div class="4">Item 4</div> <div class="4">Item 4</div> <div class="1">Item 1</div> <div class="5">Item 5</div> I want to be able to click on the link for Item 1, and show only Item 1 divs and hide all other divs, click the link of Item 2, and show only Item 2 divs and hide all other divs and so on. I've seen several similar scripts but nothing that seemingly turns divs matching the class on/off in this manner. TIA.

    Read the article

  • Making a row of divs all be the same height using CSS

    - by pavel
    I have a row of divs that must all be the same height, but I have no way of knowing what that height might be ahead of time (the content comes from an external source). I initially tried placing the divs in an enclosing div and floated them left. I then set their height to be "100%", but this had no perceptible effect. By setting the height on the enclosing div to a fixed-height I could then get the floated divs to expand, but only up to the fixed height of the container. When the content in one of the divs exceeded the fixed height, it spilled over; the floated divs refused to expand. I Googled this floated-divs-of-the-same-height problem and apparently there's no way to do it using CSS. So now I am trying to use a combination of relative and absolute positioning instead of floats. This is the CSS: <style type="text/css"> div.container { background: #ccc; position: relative; min-height: 10em; } div.a { background-color: #aaa; position: absolute; top: 0px; left: 0px; bottom: 0px; width: 40%; } div.b { background-color: #bbb; position: absolute; top: 0px; left: 41%; bottom: 0px; width: 40%; } </style> This is a simplified version of the HTML: <div class="container"> <div class="a">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer pretium dui sit amet felis. Integer sit amet diam. Phasellus ultrices viverra velit.</div> <div class="b">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer pretium dui sit amet felis. Integer sit amet diam. Phasellus ultrices viverra velit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer pretium dui sit amet felis. Integer sit amet diam. Phasellus ultrices viverra velit.</div> </div> This works, unless you change the min-height to something like 5em (demonstranting what happens when the content exceeds the minimum height), and you can see that while the text doesn't get cutoff, the divs still refuse to expand. Now I am at a lose. Is there any way to do this using CSS?

    Read the article

  • CSS help positioning divs inline

    - by JaPerk14
    I need help with a recurring problem that happens a lot. I want to create a header that consists of 3 sections which are positioned inline. I display them inline using the following css code: display: inline & float: leftThe problem is that when I resize my browser window the last div is pushed down and isn't displayed inline. I know it sounds like I'm being picky, but I don't want the design to distort as the visitor change's the monitor screen. I have provided the html and css code below that I am working with below. Hopefully I have explained this well enough. Thanks in advance. HTML <div class="masthead-wrapper"> &nbsp; </div> <div class="searchbar-wrapper"> &nbsp; </div> <div class="profile-menu-wrapper"> &nbsp; </div> CSS #Header { display: block; width: 100%; height: 80px; background: #C0C0C0; } .masthead-wrapper { display: inline; float: left; width: 200px; height: 80px; background: #3b5998; } .searchbar-wrapper { display: inline; float: left; width: 560px; height: 80px; background: #FF0000; } .profile-menu-wrapper { display: inline; float: left; width: 200px; height: 80px; background: #00FF00; }

    Read the article

  • DIVs of equal height

    - by Richard Mitchell
    It's the same old old problem you want to make a set of columns the same height but life it too short for the CSS only version. It's technically possible to do but nowadays you can't run the web without having javascript turned on. There must be an easier way. After a short amount of googling I came across a few solutions. A couple were GPL'd which ruled them straight out as I want Red Gate to pay for my mortgage. The best simple solution was found at. http://www.cssnewbie.com/equal-height-columns-with-jquery/...(read more)

    Read the article

  • Using JQuery to set create a flexible 3 column layout with Divs

    - by Chris Hammond
    This evening I was working on creating a Full Width skin for http://www.sccaforums.com/ , the current skin is at a fixed width, which doesn’t work very well for an active Forum when you have a browser with a high resolution. (The site runs on DotNetNuke , so this post will feature examples for DotNetNuke, but the code is applicable to any HTML pages) Basically I wanted a three column layout, and depending on if there was content in the Left and Right columns, I wanted them to not display at all,...(read more)

    Read the article

  • Two divs, one fixed width, the other, the rest

    - by Shamil
    I've got two div containers. Whilst one needs to be a specific width, I need to adjust it, so that, the other div takes up the rest of the space. Is there any way I can do this? <div class="left"></div> <div class="right"></div> // needs to be 250px .left { float: left; width: 83%; display: table-cell; vertical-align: middle; min-height: 50px; margin-right: 10px; overflow: auto } .right { float: right; width: 16%; text-align: right; display: table-cell; vertical-align: middle; min-height: 50px; height: 100%; overflow: auto } Thanks

    Read the article

  • Connect divs with (non-straight) lines [migrated]

    - by Snailer
    I'd like to develop my site with a layout that looks somewhat like houses with connected plumbing, or multiple computers connected to a network. Basically, the will be boxes floating in space, with lines connecting some of the boxes. I'd like these lines to have some turns in them as well (just simple 90 degree corners) rather than just a straight line. My question is what is the best way to achieve this, and perhaps a small example. My thoughts were to use: PHP and CSS: I could create a background grid and then, with some complicated algorithms, draw paths using the grid's borders. This would be more dynamic, but I'm not sure I can plot the math all by myself. just CSS: Perhaps this is as simple as making some pre-drawn lines like L-shapes and T-junctions, then just placing and scaling them. But I don't believe there's a way to scale an image by slicing it.. so the line width would be scaled and thus each image would look different. Any thoughts?

    Read the article

  • Show and hide divs at a specific time interval using jQuery

    - by Webrsk
    I would like to show divs at a specific interval (10 seconds) and show next div and as go on and repeat the same. ** Sequence : ** On 10th second show div1 , hide other divs , After 5seconds interval Show div 2 and hide other divs, After 5 seconds interval Show div 3 and hide other divs, and repeat the same for every 10 seconds. Code Follows: <div id='div1' style="display:none;"> <!-- content --> </div> <div id='div2' style="display:none;"> <!-- content --> </div> <div id='div3' style="display:none;"> <!-- content --> </div>

    Read the article

  • Javascript onclick stops working, multiple dynamically created divs.

    - by Patrick
    I have run into a strange problem, i am creating a lot of dynamically divs. And i recently found out that some of my divs doesn't fire the onclick event? All the divs are created using the same template, so why are some not working? Most of the time, its the 4-5 from the bottom. If you click on one of the others and then try again, you might get one of those to trigger. But only sporadically. Code to create the divs: GameField.prototype.InitField = function(fieldNumber) { var newField = document.createElement("div"); if (fieldNumber == 0 || fieldNumber == 6 || fieldNumber == 8 || fieldNumber == 17) newField.className = 'gameCellSmall borderFull gameText gameTextAlign'; else newField.className = 'gameCellSmall borderWithoutTop gameText gameTextAlign'; var instance = this; if (fieldNumber == 6 || fieldNumber == 7 || fieldNumber == 17) { } else newField.onclick = function() { instance.DivClick(fieldNumber); return false; } this.fields[fieldNumber] = newField; this.score[fieldNumber] = 0; return newField; } I added the return false to the click function, but it still behaves strangely. Why are some not triggering? I create around 18 divs / player. But it happens even if i just create one player. Do i perhaps need to cancel the event once i am done with it? (Like the return false; is trying to do)

    Read the article

  • Overlapping two divs and 'clearing' their parent div

    - by brady8
    My CSS-fu is letting me down here: What I'd like to do is position two child divs to be overlapping: Using position: absolute; top: 0px; left: 0px; is the only way I know how, with the parent set to position: relative. The problem with this is that the child divs are taken out of the layout as per the CSS spec, shrinking the parent div to height: 0px, so that I can't clear that div and put any content below. My amazing ASCII art below details what I'm going for... any ideas? As an aside, I need these divs to be overlapping exactly for jQuery fades, and maybe trying out some of the new Webkit transforms, a la Apple's cardflip demo: http://developer.apple.com/safari/library/samplecode/CardFlip/Introduction/Intro.html If there's another way to get them overlapped exactly in CSS, I'm all ears. Thanks! |-------------------------------------------------| | Parent div | | |-------------------------------------------| | | | | | | | DIVS 1 & 2 (overlapped) | | | | | | | |-------------------------------------------| | |-------------------------------------------------| ...more content below, after clearing the parent...

    Read the article

  • how to refresh mulitple divs when after posting using jquery

    - by oo
    i have a screen with multiple little widgets (all with different divs around them). i have one form and when i post (using jquery) right now it updates the single form using ajax. i want two other divs to refresh as well (that are outside the form). What is the best way to trigger a refresh of multiple different divs on a single jquery ajax post callback?

    Read the article

  • three rows divs streach ! plz

    - by rich wecks
    Dear ALl: Thank you for this amazing site, what I am trying to do is to make three divs top (nav) center and footer div top and bottom divs have fixed height My question how can I make the center div streach 100% and subtract the height of the others (divs [top and bottom])? here is the path to the test page thank you in advance note: I have given the body, html height 100%

    Read the article

  • Divs don't toggle

    - by stackoverflowuser
    I have following divs on my page <div id="rpttimeline">div 1</div> <div id="rptareaview">div 2</div> <div id="rptgalleria">div 3</div> <div id="rptremainingwork">div 4</div> <div id="rptremainingspec">div 5</div> <div id="rptremainingreq">div 6</div> <div id="rptremaininguserstory">div 7</div> Initially through css I have the first two divs set to visible and the remaining are hidden. in my document ready function I have $(document).ready(function () { window.setInterval(toggleDivs, 5000); }); function toggleDivs() { $('#rpttimeline').toggle(); $('#rptareaview').toggle(); $('#rptgalleria').toggle(); $('#rptremainingwork').toggle(); $('#rptremainingspec').toggle(); $('#rptremainingreq').toggle(); $('#rptremaininguserstory').toggle(); } when toggledivs is called the first two divs get hidden but the other divs are not visible. It seems the toggle is affecting just the first two divs. Am I missing something here?

    Read the article

  • jquery: find common elements in 2 sets of divs

    - 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> EDIT playing around with it i did something but i am not sure it can go anywhere. I created an array with the ids in both sets and in Firebug i can see an array with the values var arrEl = []; $('#set1 div, #set2 div').each( function(index) { var id = $(this).attr('id'); arrEl.push(id); //maybe somehow check the array for the values that appear twice, and add the class to the //matching divs? });

    Read the article

  • Increase width of divs, displayed side by side, using draggable events

    - by Vaibhav Shukla
    I have two divs of fixed length as of now, which loads external URL by dynamically embedding iframes inside them. Divs are appearing next to each other - one on left and other right. As of now, I have fixed their width to 50% each. But, I want to give user a flexibility to increase the width of any div to view the URL inside easily without scrolling horizontally. Something like dragging the border separating the two divs to either left or right according to his need. Is there a way I could achieve this? Please suggest any library or something. I have gone through a library twentytwenty which is used for images. I don't know how will that work for dynamic iframes. Here is the JSFiddle which displays the divs. <div> <div id="originalPage" style="width:54%;height: 730px;float:left"> <p>one div </p> </div> <div id="diffReport" style="width:45%; height: 730px;float:right"> <p>another div</p> </div> </div>

    Read the article

  • Three vertically stacked DIVs with scrolling middle

    - by Dave
    Is it possible to stack three DIVs vertically and have just the middle div scroll vertically? I don't want to use pixel heights, though, because the DIVs are inside of a dialog box that is resizeable. Something like this (pardon my lousy ASCII art): +-----------+ | Header | +-----------+ | ^| | || | Scroll || | || | v| +-----------+ | Footer | +-----------+ The goal is to have the header and and footer fixed and, as the dialog grows, the middle div would grow vertically. Maybe I'm just being stupid, but I've been fighting this for the last few hours and can't seem to get it right. The three DIVs probably need to be inside "another" DIV but when I do that, and set the height to 100%, it grows as the middle DIV grows. Again, it's probably something silly I'm not accounting for. I've also tried using a TABLE to no avail. Thanks for any help.

    Read the article

  • Question about software that tracks divs better than notepad++

    - by Jeff
    I recently got hired as a web developer, and the project that I am overseeing has a formatting issue on one of the pages because one of the divs is out of whack. It is a fairly complex page with quite a bit of php, and from what I can gather, I am missing a </div> tag somewhere, and accordingly everything is messed up. I am currently using notepad++, which is decent at lining up divs, meaning that if you click on the opening div tag, it will highlight purple and also highlight the closing one. But it seems as though if you have div tags that span several lines (hundreds) it won't work. Has anyone else run into a similar situation? Is there a better editor I could be using that would do a better job of helping me with my div issue? Or do I have to go through and line up the divs 1 by 1? (there are like over 100). Please let me know!! Thanks

    Read the article

  • Pyramind of DIVs

    - by sebastian
    Hi there, I'm trying to build a pyramid that's made of 4 DIVs. The layout looks like this: ------ | #1 | ------ ---------------- | #2 | #3 | #4 | ---------------- Moreover I need 3 additional DIVs starting at the center DIV (#3) and containing either #1, #2 or #3 additionally. These DIVs are used the build a sliding effect with jQueryUI later on. It's supposed to look like #1, #2 and #4 slide out of #3. The margin between the DIVs is supposed to be 2 pixels. I also want the whole block to be centered. Even with display: inline; and position: absolute; enabled on the visible and invisible DIVs I can't get the layout right. I used some negative margins and when it looked ok for the first time I saw that my top DIV was positioned outside of the html body. I suppose there is a more simple and elegant way to achieve what I want. Thanks in advance Sebastian Here's what I've got so far: HTML: <div id="centerbox"> <div id="main">main</div> <div id="rail_top"> <div id="top">top</div> </div> <div id="rail_left"> <div id="left">left</div> </div> <div id="rail_right"> <div id="right">right</div> </div> </div> CSS: #centerbox { height: 602px; width: 904px; margin-top: 640px; margin-left: auto; margin-right: auto; } /* blue */ #main { background-color: #33F; height: 300px; width: 300px; margin: 2px; z-index: 9999; position: absolute; display: inline; margin-left: 302px; } /* green */ #top { background-color: #3F0; height: 300px; width: 300px; z-index: 1; position: absolute; display: inline; } /* pink */ #left { background-color: #F06; height: 300px; width: 300px; z-index: 1; } /* orange */ #right { background-color: #FC0; height: 300px; width: 300px; z-index: 1; margin-left: 302px; } #rail_top { height: 602px; width: 300px; display: inline; position: absolute; margin-top: -300px; margin-left: 302px; } #rail_left { height: 300px; width: 602px; float: left; position: absolute; display: inline; margin-top: 2px; } #rail_right { height: 300px; width: 602px; float: right; position: absolute; display: inline; margin-left: 302px; margin-top: 2px; }

    Read the article

  • How to prevent DIVs from sliding over each other

    - by Haghpanah
    I’m going to use DIV-based layout instead of table-based to reduce amount of markups and speed up page loading, however I’ve found it too much tricky as I’m not CSS guru. I use following CSS class to simulate rows of a table containing one column for label and one for textbox. .FormItem { margin-left: auto; margin-right: auto; width: 604px; min-height: 36px; } .ItemLabel { float: left; width: 120px; padding: 3px 1px 1px 1px; text-align: right; } .ItemTextBox { float: right; width: 480px; padding: 1px 1px 1px 1px; text-align: left; } , <div class="FormItem"> <div class="ItemLabel"> <asp:Label ID="lblName" runat="server" Text="Name :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <p><span>User Name</span></p> </div> </div> <div class="FormItem"> <div class="ItemLabel"> <asp:Label ID="lblComments" runat="server" Text="Comments :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtComments" runat="server"></asp:TextBox> <p><span>(optional)Comments</span></p> </div> </div> These styles work fine if the height of ItemData DIVs are less than or equal to FormItem DIVs min-height. If ItemData DIVs height gets more than FormItem height then ItemText DIVs start sliding over FormItem DIVs to and ItemText and ItemData are no longer aligned. For example the following markups… <div class="FormItem"> <div class="ItemLabel"> <asp:Label ID="lblName" runat="server" Text="Name :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <p><span>User Name</span></p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> </div> </div> <div class="FormLabel"> <div class="ItemText"> <asp:Label ID="lblComments" runat="server" Text="Comments :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtComments" runat="server"></asp:TextBox> <p><span>(optional)Comments</span></p> </div> </div> I've tried several CSS attributes such as; position, float, clear… but I can not correct the problem. I’ll be appreciated for any help.

    Read the article

  • jquery select divs with same id

    - by mark
    hei guys i want to select two divs with the same id in jquery. how do i do it? i tried this and it did not work jQuery('#xx').each(function(ind,obj){ //do stuff; }); i have jquery countdown timers in a page, and i update them via ajax. some of these countdown timers repeat and that is why i need to use the same id on the divs.

    Read the article

  • cannot eliminate space between 2 horizontal divs inside containing div

    - by wantTheBest
    Should be easy, right? Just set the outer containing div's padding to zero, and set the two side-by-side divs inside the outer div to have margin:0 but that's having no effect on the space between the 2 horizontal divs. What I need is the red-outlined left div to touch the green-outlined right-side div. Despite my effort using padding and margin, the space between the 2 divs will not go away. I have looked at many answers on SO but so far no one's broken it down to this simple example -- my fiddle shows this issue, at http://jsfiddle.net/Shomer/tLZrm/7/ And here is the very simple code: <div style="border: 4px solid blue; white-space:nowrap; margin:0; padding:0; width:80%"> <div style="display:inline-block; width:45%; overflow:hidden; margin:0; border: 1px solid red"> Flimmy-flammy </div> <div style="display:inline-block; width:50%; overflow:hidden; margin:0px; border: 1px solid green"> Hambone-Sammy </div> </div>

    Read the article

  • JQuery/AJAX: Loading external DIVs using dynamic content

    - by ticallian
    I need to create a page that will load divs from an external page using Jquery and AJAX. I have come across a few good tutorials, but they are all based on static content, my links and content are generated by PHP. The main tutorial I am basing my code on is from: http://yensdesign.com/2008/12/how-to-load-content-via-ajax-in-jquery/ The exact function i need is as follows: Main page contains a permanent div listing some links containing a parameter. Upon click, link passes parameter to external page. External page filters recordset against parameter and populates div with results. The new div contains a new set of links with new parameters. The external div is loaded underneath the main pages first div. Process can then be repeated creating a chain of divs under each other. The last div in the chain will then direct to a new page collating all the previously used querystrings. I can handle all of the PHP work with populating the divs on the main and external pages. It's the JQuery and AJAX part i'm struggling with. $(document).ready(function(){ var sections = $('a[id^=link_]'); // Link that passes parameter to external page var content = $('div[id^=content_]'); // Where external div is loaded to sections.click(function(){ //load selected section switch(this.id){ case "div01": content.load("external.php?param=1 #section_div01"); break; case "div02": content.load("external.php?param=2 #section_div02"); break; } }); The problem I am having is getting JQuery to pass the dynamically generated parameters to the external page and then retrieve the new div. I can currently only do this with static links (As above).

    Read the article

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