我使用光滑的js来获取图像的滑块视图.
这是我的代码.
<div class="slider_wrap add-remove">
<%= f.fields_for :images do |image_form| %>
<%#= render 'images_fields', :f => image_form %>
<div>
<%= image_tag image_form.object.picture.url,:class=>"drop_down_link even img_prev" %>
</div>
<div class="image_upload_div">
<div class="image-upload">
<label>
<i class="fa fa-cloud-upload">
<%= image_form.file_field :picture ,:'data-role'=>"none",:onchange=>"readURL(this);" , :accept => 'image/jpeg , image/png' %>
</i>
</label>
</div>
</div>
<% end %>
<%= f.link_to_add "Add a picture", :images ,:id=>"add_pic" ,:class=>"js-add-slide", :style=>"display: none;"%>
</div>
<script>
function silder(){
slideIndex = 0;
$('.add-remove').slick({
slidesToShow: 2,
slidesToScroll: 2
});
$('.js-add-slide').on('click', function() {
$('.add-remove').slick('slickAdd');
}); …Run Code Online (Sandbox Code Playgroud) 我的应用程序中有twitter-text gem.
当我进行捆绑安装时,我收到以下错误.
需要在高优先级上解决它.
我也去了github页面https://github.com/twitter/twitter-text/issues/225
但在那里找不到解决方案.
我尝试使用下面的行直接安装,但得到了同样的错误.
gem install idn-ruby -v '0.1.0'
Run Code Online (Sandbox Code Playgroud)
错误
Fetching idn-ruby 0.1.0
Installing idn-ruby 0.1.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/inuscg/.rvm/gems/ruby-2.3.0@idt-two/gems/idn-ruby-0.1.0/ext
/home/inuscg/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20180427-13217-1wpq9sy.rb extconf.rb
checking for main() in -lidn... no
ERROR: could not find idn library!
Please install the GNU IDN library or alternatively specify at least one
of the following options if the library can only be found in a non-standard
location:
--with-idn-dir=/path/to/non/standard/location
or
--with-idn-lib=/path/to/non/standard/location/lib …Run Code Online (Sandbox Code Playgroud) 我的功能是:
function collect_que_ids(e) {
var val = e.val();
var data_lo = e.attr('data-lo');
new_hash = {};
new_hash[val] = data_lo;
if(e.is(':checked')){
if(checked_box_hash.includes(new_hash)){
checked_box_hash;
}else{
checked_box_hash.push(new_hash);
}
}
else{
new_hash_key = Object.keys(new_hash)[0]
new_hash_value = new_hash[new_hash_key]
$.each(checked_box_hash, function(key, value){
if (typeof Object.keys(value) !== 'nil') {
current_key = Object.keys(value)
if (current_key[0] == new_hash_key && value[current_key[0]] == new_hash_value) {
checked_box_hash.splice(key, 1)
}
}
})
}
};
Run Code Online (Sandbox Code Playgroud)
我在这条线上遇到错误.
if (typeof Object.keys(value) !== 'nil') {
Run Code Online (Sandbox Code Playgroud)
需要解决它.请帮忙.
我用过rails-admin.我在navbar-header栏中输入名称"myappname admin".我想用"myapp"名称更改它.我试图用自定义视图文件更改它
navigation.html.haml
.container-fluid
.navbar-header
%button.navbar-toggle.collapsed{ type: 'button', data: { toggle: 'collapse', target: '#secondary-navigation' } }
%span.sr-only= t('admin.toggle_navigation')
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand.pjax{href: dashboard_path}
/ = _get_plugin_name[0] || 'Rails'
= "myapp"
/ %small= _get_plugin_name[1] || 'Admin'
.collapse.navbar-collapse#secondary-navigation
= render partial: 'layouts/rails_admin/secondary_navigation'
Run Code Online (Sandbox Code Playgroud)
但它没有改变我的应用名称.
我有show.html.erb文件给用户在这里我添加部分文件的详细信息,如_details.html.erb
详细页面我有部分作为_form.html.erb
现在我做了这样的代码.有部分文件代码 show.html.erb
user
@user_entry
<%= render :partial => "users/details" ,:locals => {:user => user } %>
Run Code Online (Sandbox Code Playgroud)
有部分文件代码 _detail.html.erb
<%= render :partial => "users/form" %>
Run Code Online (Sandbox Code Playgroud)
我有这两个user & @user_entry我想要@user_entry变量的form 部分我怎么样?
如果有人知道,帮助我
谢谢.
我想在模式弹出窗口中打开图像/视频,这样我就可以单击一个按钮来显示图像。但是当我同时拥有图像和视频时,如何在 jQuery 中检查这些标签很困难。
我的 html 代码用于在弹出窗口中缩放图像
<div>
<img src="image/zoom-icon.png" id="zoomImg" >
<div class="bigthumb">
<img src="image/main_product_img.png" id="myImg" width="350px" height="350px">
<video class="no-display" width="350px" height="350px" controls>
<source src="image/movie.mp4" type="video/mp4">
</video>
</div>
</div>
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<img src="" class="imagepreview" style="width: 100%;" >
<video class="videopreview no-display" class="imagepreview" style="width: 100%;" controls>
<source src="" type="video/mp4">
</video>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
jQuery_file 代码在这里
<script type="text/javascript">
$('#zoomImg').on('click', function() {
console.log($(this));
if ( …Run Code Online (Sandbox Code Playgroud) 我在本地项目中注册条纹付款时遇到错误.
您的信用卡遭到拒绝.您的请求处于实时模式,但使用的是已知的测试卡.
我不知道为什么会这样.
任何人都可以帮助我摆脱它吗?
jquery ×4
html ×2
javascript ×2
arrays ×1
css ×1
hash ×1
nested-forms ×1
rails-admin ×1
ruby ×1
slick.js ×1
slider ×1