Just a question about css for mobile devices,
i have an image that is 1260px wide on my website and when i look at it on the phone it destorts the website as the res
Im not sure if you want JS, i decided to answer your question if you want CSS3, try this:
HTML:
CSS:
@media (min-device-width:320px) {
img[data-src-960px] {
content: attr(data-src-960px, url);
}
}
@media (min-device-width:960px) {
img[data-src-1260px] {
content: attr(data-src-1260px, url);
}
}
jQuery version:
$(document).ready(function() {
function imageresize() {
var contentwidth = $('#content').width();
if ((contentwidth) < '960'){
$('.imageclass').attr('src','image-960px.jpg');
} else {
$('.imageclass').attr('src','image-1260px.jpg');
}
}
imageresize();//Activates when document first loads
$(window).bind("resize", function(){
imageresize();
});
});