Bugzilla
Quick Search
Browse
Advanced Search
Reports
Quick Search Help
Documentation
New Account
Log In
Login with GitHub
Remember
Forgot Password
Mozilla Home
Privacy
Cookies
Legal
Attachment 8930019 Details for
Bug 1418433
reduced html
media.html (text/html), 1.24 KB, created by
Alice0775 White
(
hide
)
Description:
reduced html
Filename:
MIME Type:
Creator:
Alice0775 White
Size:
1.24 KB
patch
obsolete
><!DOCTYPE html> ><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> ><head> ><script> >matchMedia = function() { > "use strict"; > var style = document.createElement('style'); > style.type = 'text/css'; > style.id = 'matchmediajs-test'; > document.head.appendChild(style); > > var info = window.getComputedStyle(style, null) || style.currentStyle; > > var styleMedia = { > matchMedium: function(media) { > style.textContent = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; > > // Test if media query is true or false > return info.width === '1px'; > } > }; > > > return function(media) { > styleMedia.matchMedium(media || 'all') > return { > matches: styleMedia.matchMedium(media || 'all'), > media: media || 'all' > }; > }; > }(); > >//1st try: matchMedia('(min-width: 3000px) > matchMedia('(min-width: 3000px)').matches; > >//2st try: matchMedia('(min-width: 1000px) >alert( matchMedia('(min-width: 1000px)').matches ); > > ></script> ></head> ><body> ></body> ></html>
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script> matchMedia = function() { "use strict"; var style = document.createElement('style'); style.type = 'text/css'; style.id = 'matchmediajs-test'; document.head.appendChild(style); var info = window.getComputedStyle(style, null) || style.currentStyle; var styleMedia = { matchMedium: function(media) { style.textContent = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // Test if media query is true or false return info.width === '1px'; } }; return function(media) { styleMedia.matchMedium(media || 'all') return { matches: styleMedia.matchMedium(media || 'all'), media: media || 'all' }; }; }(); //1st try: matchMedia('(min-width: 3000px) matchMedia('(min-width: 3000px)').matches; //2st try: matchMedia('(min-width: 1000px) alert( matchMedia('(min-width: 1000px)').matches ); </script> </head> <body> </body> </html>
Actions:
View
Attachments on
bug 1418433
:
8929548
|
8929760
|
8930019
|
8930022
|
8930024
|
8930055
|
8931941
|
8931942
|
8932361
|
8932802