0

I'm supposed to make a PC site readable on mobile devices. I'm using Jquery Mobile CSS, which works quite ok.

The problem: the current site uses some Google 728x90px banners, which break my mobile layout.

Question
Is there any way to Jquery-set their width to 100%?

I can add borders using this Jquery (although the banner loads first, so this already breaks my layout), but I can't set the width like this.

$('.widget-content ins, .widget-content img').css({ 'border':'5px solid red', 'width':'22px !important'});

Can this be done any better? Would I want to do this?

What would be a workaround if a site uses Jquery-Mobile to display across all devices (PC&mobile) and the ads are just configured for desktop?

Thanks for some inputs and hopefully an easy Jquery "patch"

Kara
  • 6,115
  • 16
  • 50
  • 57
frequent
  • 27,643
  • 59
  • 181
  • 333

1 Answers1

0

I use this to edit the ins of the google ad:

   $($('ins').first()).css({
        ...
   })
Naftali
  • 144,921
  • 39
  • 244
  • 303
  • Can't edit the width like this, because width is set on the element via style=""; Any idea how to override this? – frequent Oct 31 '11 at 20:50
  • Got it. Plain CSS using important works. Here is the question on it: http://stackoverflow.com/questions/1933248/override-property-in-style-attribute – frequent Oct 31 '11 at 20:55
  • Another way of doing it is with .style.width="100%" – Naning Nov 01 '11 at 09:15