javascript - Greasemonkey: Unable to move div classes -
i've been trying use personal grease/tampermonkey script use on twitch.tv
currently i'm trying move stats , stream-config-status above dash-hostmode-contain. found this post , tried re-working fit want. had setup http://jsfiddle.net/7l2s180s/3/ pretty inexperienced failed.
<div class="grid c7" id="controls_column"> <div class="dash-broadcast-control">title broadcast</div> <div class="dash-hostmode-contain"> not being hosted</div> <div class="dash-hosting-contain" style="display: none;"></div> <div class="dash-player-contain js-dash-player-contain">----</div> <div id="stats"> x people watching</div> <div id="stream-config-status">good quality</div> </div>
my end goal this, haven't figured out 2 move yet.
<div class="grid c7" id="controls_column"> <div class="dash-broadcast-control">title broadcast</div> <div id="stats"> x people watching</div> <div id="stream-config-status">good quality</div> <div class="dash-hostmode-contain"> not being hosted</div> <div class="dash-hosting-contain" style="display: none;"></div> <div class="dash-player-contain js-dash-player-contain">----</div> </div>
you have 2 issues in code:
- when using
queryselector()
, need add#
prefix all strings represent ids ,.
prefix all strings represent class names. - you had typo in
#stream-config-status
.
have @ updated version of jsfiddle:
http://jsfiddle.net/7l2s180s/5/
as general tip, in future can use developer console of major browsers debug error this. press f12 open it. show error messages.
Comments
Post a Comment