I am working in sinatra, with Coffeescript and rightjs.
in the body of the html I have a div
<div id="loginimage">
<img src="/images/login.png">
</div>
and a footer element
<footer>
<div id="footer">
<form action="/login" class="login" method="post">
</form>
</div>
</footer>
and finally my coffee script looks like:
$(document).onReady ->
"#loginimage".onClick ->
"#footer".toggle "fade"
I want to be able to click on the div with id loginimage and toggle the footer element, right now I have it toggling the div with id footer, how can I select html5 elements like footer? What am I doing wrong?
I'm not that familiar with RightJS but I suspect that you'd just use a normal
<footer>
selector in the string:No hash (
id
selector), no dot (class selector), just the element name. The String documentation for RightJS even includes things like this:so presumably the string that you're calling RightJS methods on is just any old selector.