I've set various media queries on my project which change the body:after
content to different values depending on the viewport.
For the purposes of this I've made a Codepen and added my values on a div called .example
The Scss:
.example{
width: 10%;
height: 100px;
background: Tomato;
position: relative;
float: left;
color: black;
margin-right: 20px;
@include respond-to(wide-screens) {
&:after{
content: "wide-screens";
}
}
@include respond-to(ninesixty) {
width: 32.333%;
margin-right: 1%;
margin-bottom: 1%;
&:after{
content: "ninesixty";
}
}
@include respond-to(handhelds) {
width: 49%;
margin-right: 1%;
margin-bottom: 1%;
&:after{
content: "handhelds";
}
}
}
the jQuery:
if ($('.example').css("content","wide-screens")){
console.log("wide-screens");
}
else if ($('.example').css("content","ninesixty")){
console.log("ninesixty");
}
From my experiments though it's only ever showing one value despite another being set. The console log will only ever show: wide-screens
Can anyone point out what I'm doing wrong?
The Codepen: http://codepen.io/vdecree/pen/LybJh