Search Results

Search found 11623 results on 465 pages for 'css positioning'.

Page 67/465 | < Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >

  • Monitoring Html Element CSS Changes in JavaScript

    - by Rick Strahl
    [ updated Feb 15, 2011: Added event unbinding to avoid unintended recursion ] Here's a scenario I've run into on a few occasions: I need to be able to monitor certain CSS properties on an HTML element and know when that CSS element changes. For example, I have a some HTML element behavior plugins like a drop shadow that attaches to any HTML element, but I then need to be able to automatically keep the shadow in sync with the window if the  element dragged around the window or moved via code. Unfortunately there's no move event for HTML elements so you can't tell when it's location changes. So I've been looking around for some way to keep track of the element and a specific CSS property, but no luck. I suspect there's nothing native to do this so the only way I could think of is to use a timer and poll rather frequently for the property. I ended up with a generic jQuery plugin that looks like this: (function($){ $.fn.watch = function (props, func, interval, id) { /// <summary> /// Allows you to monitor changes in a specific /// CSS property of an element by polling the value. /// when the value changes a function is called. /// The function called is called in the context /// of the selected element (ie. this) /// </summary> /// <param name="prop" type="String">CSS Properties to watch sep. by commas</param> /// <param name="func" type="Function"> /// Function called when the value has changed. /// </param> /// <param name="interval" type="Number"> /// Optional interval for browsers that don't support DOMAttrModified or propertychange events. /// Determines the interval used for setInterval calls. /// </param> /// <param name="id" type="String">A unique ID that identifies this watch instance on this element</param> /// <returns type="jQuery" /> if (!interval) interval = 200; if (!id) id = "_watcher"; return this.each(function () { var _t = this; var el$ = $(this); var fnc = function () { __watcher.call(_t, id) }; var itId = null; var data = { id: id, props: props.split(","), func: func, vals: [props.split(",").length], fnc: fnc, origProps: props, interval: interval }; $.each(data.props, function (i) { data.vals[i] = el$.css(data.props[i]); }); el$.data(id, data); hookChange(el$, id, data.fnc); }); function hookChange(el$, id, fnc) { el$.each(function () { var el = $(this); if (typeof (el.get(0).onpropertychange) == "object") el.bind("propertychange." + id, fnc); else if ($.browser.mozilla) el.bind("DOMAttrModified." + id, fnc); else itId = setInterval(fnc, interval); }); } function __watcher(id) { var el$ = $(this); var w = el$.data(id); if (!w) return; var _t = this; if (!w.func) return; // must unbind or else unwanted recursion may occur el$.unwatch(id); var changed = false; var i = 0; for (i; i < w.props.length; i++) { var newVal = el$.css(w.props[i]); if (w.vals[i] != newVal) { w.vals[i] = newVal; changed = true; break; } } if (changed) w.func.call(_t, w, i); // rebind event hookChange(el$, id, w.fnc); } } $.fn.unwatch = function (id) { this.each(function () { var el = $(this); var fnc = el.data(id).fnc; try { if (typeof (this.onpropertychange) == "object") el.unbind("propertychange." + id, fnc); else if ($.browser.mozilla) el.unbind("DOMAttrModified." + id, fnc); else clearInterval(id); } // ignore if element was already unbound catch (e) { } }); return this; } })(jQuery); With this I can now monitor movement by monitoring say the top CSS property of the element. The following code creates a box and uses the draggable (jquery.ui) plugin and a couple of custom plugins that center and create a shadow. Here's how I can set this up with the watcher: $("#box") .draggable() .centerInClient() .shadow() .watch("top", function() { $(this).shadow(); },70,"_shadow"); ... $("#box") .unwatch("_shadow") .shadow("remove"); This code basically sets up the window to be draggable and initially centered and then a shadow is added. The .watch() call then assigns a CSS property to monitor (top in this case) and a function to call in response. The component now sets up a setInterval call and keeps on pinging this property every time. When the top value changes the supplied function is called. While this works and I can now drag my window around with the shadow following suit it's not perfect by a long shot. The shadow move is delayed and so drags behind the window, but using a higher timer value is not appropriate either as the UI starts getting jumpy if the timer's set with too small of an increment. This sort of monitor can be useful for other things as well where operations are maybe not quite as time critical as a UI operation taking place. Can anybody see a better a better way of capturing movement of an element on the page?© Rick Strahl, West Wind Technologies, 2005-2011Posted in ASP.NET  JavaScript  jQuery  

    Read the article

  • Dynamic User Specific CSS Selection at Run Time

    I had a cool question while I was at MIX. A developer needed the ability to have his site render pages using a CSS file selected based on some user specific criteria. ASP.NET 4 controls generate CSS friendly output and more and more we web developers are using CSS for layout etc. Using multiple CSS files in our site wide templates we can not only provide different aesthetic experiences but we can chage the style based on the device type (Printer ot Phone) or the special needs of the end user...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Adobe sort Project Parfait, un outil en ligne pour extraire le CSS de votre PSD

    Adobe Project Parfait : extraire le CSS de votre PSDAdobe signe un bel outil qui promet de rendre de bons services aux webmaster en permettant d'extraire le code CSS d'un fichier PSD dans le navigateur. Dans le navigateur? C'est à dire que la version actuelle (beta) est gratuite et ne nécessite pas de posséder Photoshop pour l'utiliser.On peut imaginer que le webmaster a reçu la maquette d'une page en PSD qu'il lui suffit d'uploader sur Project Parfait pour en extraire le CSS.L'interface intuitive...

    Read the article

  • Automatically minify and combine JavaScript and CSS files in any web site

    This article describes a complete package that speeds up loading of JavaScript, CSS, and images in an ASP.NET web site. It accomplishes this by minifying JavaScript and CSS files on the fly (and caching the minified content), combining JavaScript and CSS files, making it easy to load files from cookieless domains, and much more. This article has full step by step installation instructions for both IIS 7 and IIS 6 (each version requires different additions to web.config). It will also detail how to use all the features, complete with short examples.

    Read the article

  • Cloudflare displaying cached CSS in-line?

    - by esqew
    I recently enabled CloudFlare on my domain, and when I make HTML statements like this: <link href="css/main.css" rel="stylesheet" /> The CSS gets displayed in-line, like this: <style>body{padding-top:40px}span.light{font-weight:lighter!important}span.title{font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}</style> When I update the file via FTP, the changes are not reflected, which leads me to believe that this is a caching issue. Is this due to CloudFlare? If so, how do I disable the behavior? EDIT I also came to the conclusion that caching is behind the behavior after being able to see changes in the page after re-naming the CSS file.

    Read the article

  • Free ebook: Programming Windows 8 Apps with HTML, CSS, and JavaScript

    - by TATWORTH
    Originally posted on: http://geekswithblogs.net/TATWORTH/archive/2013/11/03/free-ebook-programming-windows-8-apps-with-html-css-and.aspxAt http://blogs.msdn.com/b/microsoft_press/archive/2012/10/29/free-ebook-programming-windows-8-apps-with-html-css-and-javascript.aspx, there is a free E-Book: Programming Windows 8 Apps with HTML, CSS, and JavaScript. "This free E-book provides comprehensive coverage of the platform for Windows Store apps."

    Read the article

  • Le forum CSS change de nom et devient « Mise en page CSS », pour mettre en avant la notion de mise en page

    Comme vous avez peut-être constaté, le forum CSS a changé de nom pour devenir Mise en page CSS.Cette modification a été faite pour essayer de refléter au mieux la finalité de ce forum. Le nouveau nom choisi met plus en avant la notion de mise en page.Nous vous rappelons aussi que ce forum porte sur toutes les versions de CSS, ce qui ne nous a pas semblé utile d'indiquer dans le nouveau nom.Enfin, ce forum étant avant tout destiné à ses utilisateurs, toutes propositions d'améliorations (qui peuvent...

    Read the article

  • I lost my CSS Codes of my important Website, Why?

    - by Hooshkar
    Very weird, i had opened notepad ++ and working on my CSS codes for my website, suddenly my little niece unplugged the computer, when i re-start the computer and opened again the same CSS codes file in notepad ++, so all i am seeing is "NULL NULL NULL NULL NULL NULL NULL" there is no codes, all lost. I opened the same CSS codes file in other editors and its all empty no codes.. is there a way to fix it, because it was my hard work. and what can be the cause? Thank you.

    Read the article

  • What are the drawbacks of using PHP to create variables in my CSS stylesheet?

    - by Greg
    One significant drawback of CSS is that one can't use variables. For example, I'd like to use variables to control the location of imported CSS, and it would be awesome to create variables for colors that are used repeatedly in a design. One approach is to use a PHP file for the CSS stylesheet. In other words, create a "style.php" with... <?php header("Content-type: text/css"); ?> ...at the top of the file, and then link to it using... <link href="style.php" rel="stylesheet" type="text/css" /> ...in any file that uses these styles. So what's the catch? I think it might be performance -- I did a few quick experiments in Firefox/Firebug and as one would expect, the CSS stylesheet is cached, but the PHP stylesheet isn't. So we're paying the price of an additional GET. The other annoying thing is that TextMate does not syntax highlight properly for CSS in a .php file. Are there other drawbacks? Have you used this approach, and if so, would you recommend it?

    Read the article

  • Dynamic columns/rows

    - by Fuego DeBassi
    Wondering--does anyone know of any good articles explaining the CSS technique allowing multiple instances of a class to flow down the page relative to the items above it. Not explaining it that well. Veerle' Pierter's does it on this page: http://veerle.duoh.com/belgiangraphicdesign Although I'm not sure I want to use a technique like her's that requires entering of the height per element via her EE installation. I made a little graphic of what I am trying to acheive; http://cl.ly/71163510ce9d294f9f33 The key is I need a robust technique for doing it. Something where the markup could be as simple as; <div class="box"> Number 1 </div> <div class="box"> Number 2 </div> <div class="box"> Number 3 </div> <div class="box"> Number 4 </div> <div class="box"> Number 5 </div> ... Would love any pointers in the right direction.

    Read the article

  • Dynamic margin (or simulation of margin) between left floated divs

    - by BugBusterX
    I have a number of divs floated left. When browser is resized they move down or up based on how many can fit on the line. I was wondering if there is a way to dynamically (with css) have those divs align (or have margin) in a way, that they would always fill the entire screen space by having their marhin resize? In other words margin between them would resize while browser is resized, but as soon as another div can fit it will be added in the line, or if minimum margin is reached and passed another div goes to next line while margins expand again. Here's an example how it is now, resize the wondow to see he leftover space that I want to "fill" <html> <head> <style> .test { float:left; width: 100px; height:100px; background-color: grey; margin: 0 10px 10px 0; } </style> </head> <body> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> <div class="test"></div> </body> </html>

    Read the article

  • Aligning decimal points in HTML

    - by ijw
    I have a table containing decimal numbers in one column. I'm looking to align them in a manner similar to a word processor's "decimal tab" feature, so that all the points sit on a vertical line. I have two possible solutions at the moment but I'm hoping for something better... Solution 1: Split the numbers within the HTML, e.g. <td><div>1234</div><div class='dp'>.5</div></td> with .dp { width: 3em; } (Yes, this solution doesn't quite work as-is. The concept is, however, valid.) Solution 2: I found mention of <COL ALIGN="CHAR" CHAR="."> This is part of HTML4 according to the reference page, but it doesn't work in FF3.5, Safari 4 or IE7, which are the browsers I have to hand. It also has the problem that you can't pull out the numeric formatting to CSS (although, since it's affecting a whole column, I suppose that's not too surprising). Thus, anyone have a better idea?

    Read the article

  • Floats being pushed down in IE8 but not IE7 or Firefox

    - by BReno
    The page in question is here: http://supportdogs.digitalportals.net/PhotoGallery/16-Events You can see in IE8 that the content is being pushed down under the sidebar. If you view it in IE8 compatibility mode, it doesn't happen, nor does it happen in Firefox. If you browse to a different page in IE8 the issue does not persist. The basic layout is <div class="contentContainer"> <div class="left"></div> <div class="right"></div> </div> The css for those three classes is here #contentContainer { background: transparent url('../images/bodyBG.png') repeat-y center top; clear: both; padding: 0px 30px 0px 30px; margin-top: 83px; width: 935px; } #contentContainer .left { float: left; margin-top: 60px; padding-left: 5px; width: 195px; } #contentContainer .right { float: right; margin: -55px 0px 20px 0px; min-height: 620px; width: 700px; } Anyone have any idea what could be causing this?

    Read the article

  • Centered DIV w/ width dependant on text, buffered by two divs that should fill the containing DIV

    - by Andrew Thompson
    I have been wracking my brains on this seemingly small issue the whole day. My web dev friends are baffled and I could not find a suitable answer in my search of this site and others (though, I could have missed it somewhere along the way). Here's the problem: 3 DIVS within one fixed-width container DIV The center DIV has text that will be different on other sites The center DIV needs to be centered, and no larger than the text it contains. This is what I'd like to end up with The basic HTMl: <div id="container" > <div id="left" ></div> <div id="center" >Text inside center should resize this block</div> <div id="right" ></div> </div> Below, I removed most of the styles I have tried. This CSS currently centers the DIV (if I set it as an inline block), but I need the other divs to fill the left and right space remaining: #container { width:750px; text-align:center; } #left { background-color:#E85355; } #center { background-color:#CDD7D7; display:inline-block; } #right { background-color:#65A8A6; } I've tried floating, no-wrap, overflow, etc. Thanks a million to whomever can offer some help! JSFiddle Link

    Read the article

  • Blockquote border on tumblr theme

    - by orange
    This is the code for the link block: {block:Link} <div class="post link"> <h2> <a href="{URL}" class="name">{Name}</a></h2> <div class="content"> {block:Description}{Description}{/block:Description} <span class="date"> <a href="{Permalink}">{ShortMonth} {DayOfMonth}, {Year} </a> </span> </div> </div> {/block:Link} What I'm trying to do is add a border-left of of 10px to block quotes. When I try to add this style to block quotes this happens: The block quote border flows into the post title and I don't wish for this to happen, I want the border layout to stay within the content div. I'm using this CSS at the moment: div div div blockquote { border-left: 10px solid red; } Thanks in advance for the help! Just to clarify <div class="post link"> is in another div. Here is the tumblr: http://iamsomething-awesome.tumblr.com/

    Read the article

  • using same ids for many tags?

    - by gaurav rathor
    here is the example code that i was testing and i got confused that every one says that we can use or we should use only one time per id but i have testes using using it multiple times but its giving me the correct output. so what should i do. it is kinda working same like class for me in this example code: <html> <head> <style> #exampleID1 { background-color: blue; } #exampleID2 { text-transform: uppercase; } </style> </head> <body> <p id="exampleID1">This paragraph has an ID name of "exampleID1" and has a blue CSS defined background.</p> <p id="exampleID2">This paragraph has an ID name of "exampleID2" and has had its text transformed to uppercase letters.</p> <address id="exampleID1"> Written by W3Schools.com<br /> <a href="mailto:[email protected]">Email us</a><br /> Address: Box 564, Disneyland<br /> Phone: +12 34 56 78 </address> <blockquote id="exampleID1"> Here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation here is a long quotation. </blockquote> </body> </html> please see the above code and answer me that why we should not use id selector two times in a page while its working fine.

    Read the article

  • Is there a selector or a work around to select any element with no children.

    - by rnaud
    Looking at the CSS3 specs, I can't find any way to select any element that has no children. Let me explain. <body> <h1>Main Page</h1> <div id="main"> <div class="post"> <h2>Article 1</h1> <p>some text</p> </div> <div class="post"> <h2>Article 2</h1> <p>some text</p> </div> </div> </body> I'm looking for a CSS syntax to select the h1, the two h2 and the two p. A way to select in any page, all elements with no children. Any suggestion ? Sorry, I forgot to add the "empty" part, I am actually already using the *:empty selector, but it's not working for any tag that has a nodeText as a child. So it's working for any input, image, object, but not for h2, h1, or any p.

    Read the article

  • Why doesn't my <div> float around another floated <div> while other elements do?

    - by user1848605
    I have a container with background color green. Inside that green <div>, I have a <div> which is black and styled as a box (50px x 50px) - this <div> is floated to the left. Now if I add a <p> to my markup after the grey <div>, I'd expect it to float around the grey <div>. And it does. However, when I substitue with another <div> which is styled as box (set height and width), it doesn't float around anymore, but disappears behind the floating div. Even if I have first paragraphs which are floating around correctly and THEN I add the div (box), the paragraphs stop floating around and appear on another line. HTML: <div id="greencontainer"> <div id="blackbox"></div> <!--this one is float:left;--> <p>A paragraph that floats around the previous div</p> <div id="anotherbox"></div> <!-- if I add another div with set width and height, it disappears behind the floated one, and even prevents the paragraph from floating around.--> </div> CSS: #blackbox { width:50px; height:50px; background-color:black; float:left; } #p { margin:0px; padding:0px; } #anotherbox { width:50px; height:50px; background-color:grey; }

    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

  • How do I size a second div to be 100% height underneath a fixed image?

    - by mk
    I'm using semi-transparent PNGs (due to the designer's overlapping of elements) and trying to achieve a layout that represents the design while still working well on the web. Thus I have simple HTML: <div id="right"> <div id="welcome"></div> <div id="welcomeRepeatingBottom"></div> </div> And I'm trying to use CSS as follows: #right { height: 100%; position: absolute; right: 0px; top: 0px; width: 430px; } #welcome { background-image: url("welcome.png"); height: 614px; width: 430px; position: absolute; top: 0px; left: 0px; } #welcomeRepeatingBottom { background: url("welcomeBottom.png") repeat-y; height: 100%; left: 0px; position: absolute; top: 614px; width: 430px; } The problem is...the #welcomeRepeatingBottom div can't overlap the #welcome div because of the transparency. What I really want is the #welcomeRepeatingBottom div to be height: 100% - 614px, but of course you can't do that. Am I missing something here or do I need to manipulate these values with JavaScript/JQuery?

    Read the article

  • CSS: Freeze table header and first column, *but only on certain axes*

    - by Mega Matt
    Hello all, I have a variation on a common question, and I'll try to explain it as best I can. It may take some visualization on your part. I have an HTML table (in reality there are tables within tables within divs within tables -- I'm using the JSGantt plugin). I'd like for the table header to be frozen only when I scroll down on the y-axis, but if I need to scroll right to see more data, I would like it to scroll right. Meanwhile, as I scroll down (with the header row staying put), I'd like the first column of the table to scroll down with me. But when I scroll right, I want the first column to stay put (but as I mentioned above, the header row to scroll with me). So essentially I've frozen the first column only on the x-axis and the header row only on the y-axis. I'll stop there for now. If anyone needs more clarification I can try to explain. I've tried this multiple ways, but I'm convinced that it may not be possible without some serious javascript. The table, by the way, is contained within an outer div with set dimensions, hence the need for me to scroll the data. Any help you can provide would be greatly appeciated. Thanks very much.

    Read the article

  • RadcomboBox css help needed

    - by Kobojunkie
    I am trying to change the font color on disabled radcombobox control. Any idea what I may be doing wrong in the code below for the font color not to work? .RadComboBox_Web20 .rcbDisabled .rcbInputCell input, .RadComboBox_Web20 .rcbDisabled .rcbInputCell .rcbItem, .RadComboBox_Web20 .rcbDisabled .rcbInputCell .rcbInput, .RadComboBoxDropDown_Web20 .rcbDisabled .rcbInputCell input, .RadComboBoxDropDown_Web20 .rcbDisabled .rcbInputCell .rcbItem, .RadComboBoxDropDown_Web20 .rcbDisabled .rcbInputCell .rcbInput, .RadComboBoxDropDown_Web20 .rcbDisabled { background-color: #808080; color: #0000FF; font-weight: bold; background-image: none; }

    Read the article

  • Advanced CSS layout problem

    - by Tower
    Hi, I want to create a dialog with a title, borders (left, right, bottom) as well as the content. The current source code: <html> <body> <div style="background: #0ff; width: 152px; height: 112px; position: absolute; top: 24px; left: 128px; display: table"> <div style="display: table-row;"> <div style="background: #f00; width: 100%; display: table-cell;height: 24px;">top</div> </div> <div style="display: table-row;"> <div style="background: #0f0; width: 100%; display: table-cell;"> <div style="display: table;"> <div style="display: table-row;"> <div style="display: table-cell; width: 4px; height: 100%; background: #000;"></div> <div style="display: table-cell;"> <div style="overflow: scroll; white-space: nowrap"> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe cwe <br /> </div> </div> <div style="display: table-cell; width: 4px; height: 100%; background: #000;"></div> </div> </div> </div> </div> <div style="display: table-row;"> <div style="background: #000; width: 100%; display: table-cell; height: 4px;"></div> </div> </div> </body> </html> produces an output of what happened to the left and the right borders and why does the size exceed the width specified in the top parent (152px)?

    Read the article

  • on hover overlay image in CSS

    - by Juventus
    I need a div with picture bg to overlay an image (with some amount transparency) when hovered on. I need to be able to have one transparent overlay that can be used and reused throughout the site on any image. My first attempt was round-about to say the least. Because I found out you cannot roll-over an invisible div I devised a sandwhich system in which the original image is the first layer, the overlay is the second layer, and the original image is third layer again. This way, when you roll-over, the original image disappears revealing the overlay image over the original image: http://www.nightlylabs.com/uploads/test.html So it works. Kinda. Because of you cannot interact with an visibility:invisible element (why?!) the roll-over flickers unless you rest the cursor on it. Any help? This method is bad so if anyone has a better one please comment.

    Read the article

< Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >