dynamic-css

Capturing Print Event via jQuery

狂风中的少年 提交于 2020-01-14 13:47:41
问题 I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called "onbeforeprint" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)? Before you ask, I can't easily use a print media stylesheet to apply the changes as the elements I need to change have inline styles which can't be overridden with a global stylesheet. I need

How do you dynamically load a CSS file into a Flex application?

假如想象 提交于 2020-01-10 03:57:05
问题 I know that you can apply CSS in order to style objects in Flex using the StyleManager: http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html You can also load compiled CSS files (SWFs) dynamically: http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html However, I'm dynamically creating my CSS files using a web GUI and a server-side script. If the CSS is changed, then the script would also need to compile the CSS into an SWF (which is not a viable option). Is

jQuery css() function changing 'a' property not 'a:hover' property

元气小坏坏 提交于 2019-12-30 06:29:12
问题 I'm having a bit of trouble with the jQuery css() function at the moment. It is changing the css value of the anchor element's border-top-color instead of just the anchor element's border-top-color when hovered. Below is my code. $("#header #headerlist li a:hover").css("border-top-color","rgb(225, 149, 79)"); Why does it change the #header #headerlist li a border-top-color and the #header #headerlist li a:hover properties rather than just the #header #headerlist li a:hover property? 回答1: The

Less dynamic class-names generated at runtime, or classes generated from array loop

折月煮酒 提交于 2019-12-25 02:25:32
问题 Currently, one of my developers have developed this less file: .countryFlag( @countryName :"DK"){ content: url("/images/flags/@{countryName}.gif") no-repeat center; } a.flag-DK { .countryFlag (); } a.flag-DE { .countryFlag (DE); } a.flag-EE { .countryFlag (EE); } ... with some 20 countries. I was wondering if this can be done smarter with less, either using loops or dynamic names created at runtime. Consider the following pseudo-code that describes what I want: a.flag-@{country} { content:

JavaScript: Advantages and disadvantages of dynamically (on fly) creating style element

六月ゝ 毕业季﹏ 提交于 2019-12-18 12:27:53
问题 In JavaScript we can create <style> element dynamically and append to <head> section in order to apply CSS rule for huge number of elements. What is advantages or disadvantages of this approach? If it is really gives performance gain comparing to javascript iteration over elements. What goes behind the scene (inside of browser)? Which one is faster or slower? Javascript iteration over elements or adding css dynamically in browser? What about processing time? processing load? For better

How do I create dynamic CSS in Rails?

霸气de小男生 提交于 2019-12-18 10:46:18
问题 what is the best/most efficient way of creating dynamic CSS with Rails. I am developing an admin area on a site, where I would like a user to be able to customize the style of their profiles(Colour mostly), which will also be saved. Would you just embed ruby script in the css file? Would you need to change the file extension from css? Thanks. 回答1: Currently there is a lot of options to generate dynamic css in rails. You can use less css - is an extension to CSS with extra features. Gem Less

Javascript: Change CSS File Dynamically + Cookie

眉间皱痕 提交于 2019-12-18 04:27:09
问题 I want to change the used CSS File ( <link href="..." /> ) dynamically using only javascript and to save changes in cookies. This is a jQuery version that does what I want (ref), but how can I do this in javascript? if($.cookie("css")) { $("link").attr("href",$.cookie("css")); } $(document).ready(function() { $("#nav li a").click(function() { $("link").attr("href",$(this).attr('rel')); $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'}); return false; }); }); Thank you in advance.

Changing background based on time of day (using javascript)

佐手、 提交于 2019-12-17 06:52:50
问题 Okay, I have two different background .jpgs that I want to used as the backgroud depending on what time of day it is. I want the sunny background from 7am to 8pm and the night background from 8pm to 7am. I'm working on a remote html file and I have the backgrounds and graphics stored on a separate server from the actual html file. Most of the css is in the html file except for the the body section that contains the background code which I separated and moved to an external style sheet. I made

Changing background based on time of day (using javascript)

徘徊边缘 提交于 2019-12-17 06:52:41
问题 Okay, I have two different background .jpgs that I want to used as the backgroud depending on what time of day it is. I want the sunny background from 7am to 8pm and the night background from 8pm to 7am. I'm working on a remote html file and I have the backgrounds and graphics stored on a separate server from the actual html file. Most of the css is in the html file except for the the body section that contains the background code which I separated and moved to an external style sheet. I made

Converting css class names to random letters

限于喜欢 提交于 2019-12-12 16:30:22
问题 I read stylesheets of facebook and Google and i noticed that class names used in css styles are some random letters and numbers? can we convert all css classes names to some random letters after developing web page? how they did it? is there any tool for doing this? 回答1: I believe the answer you're looking for is the same one given here: Google uses something called the Google Web Toolkit (or simply GWT) to compile Java "applications" into their Javascript/HTML/CSS counterparts. GWT was used