Export to GitHub

css3-mediaqueries-js - issue #1

Can the script be extended to include links


Posted on Mar 11, 2010 by Happy Rhino

> What steps will reproduce the problem?

  1. Include <link rel="stylesheet" href="media-wide.css" media="screen and (min-width: 1000px)" /> in the markup, along with css3-mediaqueries.js
  2. Resize the window above 1000px.

> What is the expected output? What do you see instead?

I would expect to see the new styles in media-wide.css included. (I now realize that @media blocks in non-query-enabled link elements are parsed.)

> Please provide any additional information below.

I realize that this would be an enhancement of the existing script.

Comment #1

Posted on Mar 7, 2011 by Grumpy Panda

Comment deleted

Comment #2

Posted on Mar 7, 2011 by Grumpy Panda

Comment deleted

Comment #3

Posted on Mar 7, 2011 by Grumpy Panda

Comment deleted

Comment #4

Posted on Mar 7, 2011 by Grumpy Panda

IMPORTANT NOTE: I only managed to get css3-mediaqueries.js to work for std IE desktops (my control for older browsers without media query support) when hosted on a server or localhost server.

Comment #5

Posted on Feb 19, 2012 by Happy Elephant

Same for me: only works when hosted on a server or localhost server.

Comment #6

Posted on Jun 19, 2012 by Happy Lion

I managed to make this work with tags with a little patch. If you download the development version (http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries_src.js) and and go to line 436 and add this small snippet:

if(link.getAttribute("media").replace(/^\s\s*/, '').replace(/\s\s*$/, '') != ""){ text = "@media " + link.getAttribute("media").replace(/^\s\s*/, '').replace(/\s\s*$/, '') + "{" + text + "}";}

Then you can make it work.

Attachments

Comment #7

Posted on Jul 5, 2012 by Quick Bird

+1 for incorporating softtek's fix into the codebase...

Comment #8

Posted on Nov 28, 2012 by Quick Dog

Hi softtek I have tried the above code with applied patch but still the is not working.

Comment #9

Posted on May 31, 2013 by Helpful Bird

It may work.. Try in localhost or your server.

Comment #10

Posted on Jul 9, 2013 by Massive Ox

I have used CSS-mediaqueries.js on my file but there is not working properly in ie8. Please resolve this issue ASAP. Anyone can help me?

Attachments

Comment #11

Posted on Jul 14, 2013 by Happy Rhino

Assuming this project is abandoned; would like to mark this issue Closed / WontFix.

Comment #12

Posted on Aug 24, 2013 by Massive Panda

hi, softtek. I have a try as you steps,It's OK when running in the local testing server, but as it release on server,It doesn't work? what about that ? could you help me ?

Comment #13

Posted on Apr 4, 2014 by Happy Ox

Back from the dead... There is a new version of the script. It has some CSS parsing and processing improvements. If you're still using it, or would like to try again, could you confirm that this issue is solved or not?

Status: New

Labels:
Type-Defect Priority-Medium