Change css property through Javascript

47 views
Skip to first unread message

Mimi Maqueda

unread,
Dec 15, 2017, 1:01:33 PM12/15/17
to Google Visualization API
Hi, 

I was wondering if there's any way to change a css property of a ControlWrapper through Javascript? 
I know how to do it with css but I want to know if there is a way to change the control width depending on device/browser width. 
I mean something like this:

   document.getElementsByClassName('google-visualization-controls-rangefilter .google-visualization-controls-slider-horizontal').style.width = window.innerWidth;

I have tried to change it through css but when I set the control width to 100%... it doesn't work...

  .google-visualization-controls-rangefilter .google-visualization-controls-slider-horizontal {
      width: 100%;
  }

I think this happens because 100% of width is actually 200px for control...

And if there is a way to do this... where can I write it? After or before drawing the Dashboard?
I would really be grateful if you could tell me how to do it.

Daniel LaLiberte

unread,
Dec 15, 2017, 2:08:58 PM12/15/17
to Google Visualization API
Hi Mimi,

In general terms, you can set the CSS to affect the HTML of the controls, but depending on how you are doing it, you may need to use libraries like jQuery to do it.  It might be best if you can point us at the web page you are working on so we can see what is happening.



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/195842cd-4755-4784-b4b5-dd5cad8d1df6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages