您好,我尝试了我的项目的chardin js网站,但是有些方法不起作用。我正在使用Rails 3.2.14和ruby 1.9.3,而chardin js版本是0.1.3,所以请帮助我。在这里,我附上小提琴链接。
编辑:在我的项目(在视图中)尝试过相同的事情。但是,当我单击“在动作图像上查看它”时,不会出现。
家庭咖啡
$('body').chardinJs()
$('a[data-toggle="chardinjs"]').on 'click', (e) ->
e.preventDefault()
if $('.jumbotron img').is(':visible')
($('body').data('chardinJs')).toggle()
else
$('.jumbotron img').animate height: 250, 600, ->
($('body').data('chardinJs')).toggle()
$('body').on 'chardinJs:stop', ->
$('a.btn.primary').off('click').text('See more on Github')
.attr('href', 'https://github.com/heelhook/chardin.js')
$('a#opentour').css display: 'block'
CSS与小提琴一样
homes / show.html.erb
<body>
<div class="container">
<div class="jumbotron">
<h1 data-intro="Project title" data-position="right">Chardin.js</h1>
<p class="lead">
Simple overlay instructions for your apps.
</p>
<img src="http://s11.postimg.org/5j9wr7n8z/chardin.png" data-intro="An awesome 18th- century painter, who found beauty in everyday, common things." data-position="right" />
<a id="asdfg" href="#" class="btn btn-large primary" data-toggle="chardinjs" data-intro="This button toggles the overlay, you can click it, even when the overlay is visible" data-position="left">See it in action</a>
<a href="" id="opentour" class="hide" data-toggle="chardinjs">Or open it again</a>
<div class="credits">
<p data-intro="Author of this plugin, aka Pablo Fernandez" data-position="right">
Baked with
<b><3</b>
by
<a href="https://github.com/heelhook">@heelhook</a>.
</p>
</div>
</div>
<div class="links">
<p id="links" data-intro="Links to Github, Twitter, etc." data-position="top">
</p>
</div>
</div>
</body>
application.js
//= require jquery
//= require jquery_ujs
//= require chardinjs.min
//= require_tree .
我觉得您的问题可能与您的要点相同:您认为github是CDN,但事实并非如此。
对于js,请使用 https://cdn.rawgit.com/heelhook/chardin.js/master/chardinjs.js
对于CSS,请使用 https://cdn.rawgit.com/heelhook/chardin.js/master/chardinjs.css
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句