Can a else if, or else statment contain a condition ? If the condition is not meet then, nothing happens other wise one of the else if or if statements is read ?
Siberian
13
Junior Poster
Recommended Answers
Jump to PostThe else-if should have a condition, and you can have multiple else-ifs. However, you should only have one else at the end, which is run if none of the conditions are met.
if (condition) { // code } else if (condition) { // code } else { …
Jump to PostThis is for images, not for responsive pages ;)
But, there is now the srcset and the sizes attributes for this? But you knew that already, so there's no need for a JS solution. Only as a
Jump to PostThere is a need for JS-Library solution !
Do you mean a library such as jQuery? If so, then you don't need one for this.
Window.matchMedia() - part of the Web API - is especially made for using media queries in JS.if (window.matchMedia("(min-width: 1024px)").matches) …
Jump to Posthttp://caniuse.com/#feat=srcset seems to note it's mostly an IE issue but since IE is mostly on Windows PCs of big screens you have to decide to let it be just so for IE and …
Jump to PostAs far as I can see they removed the ability to show the result as a full page. Codepen.io is in that respect my preferable option.
document.getElementById("tleone").src = mqls[0].matches
You're targeting with 'tleone' the wrapper div and not the img tag, so this won't work.
All 38 Replies
rproffitt
2,565
"Nothing to see here."
Moderator
Siberian
13
Junior Poster
Siberian
13
Junior Poster
Mouche
diafol
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
rproffitt
2,565
"Nothing to see here."
Moderator
Siberian
13
Junior Poster
rproffitt
2,565
"Nothing to see here."
Moderator
amanjogi
0
Newbie Poster
gentlemedia
803
Master Poster
rproffitt
commented:
Meets condition or condition meet.
+7
Siberian
13
Junior Poster
rproffitt
2,565
"Nothing to see here."
Moderator
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Siberian
13
Junior Poster
Siberian
13
Junior Poster
gentlemedia
803
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.