| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- $(document).ready(function () {
- $('.popup-gallery').magnificPopup({
- delegate: '.popupA',
- type: 'image',
- tLoading: 'Loading image ......',
- mainClass: 'mfp-img-mobile',
- gallery: {
- enabled: true,
- navigateByImgClick: true,
- preload: [0, 1], // Will preload 0 - before current, and 1 after the current image
- arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', // markup of an arrow button
- tPrev: 'Previous (Left arrow key)', // title for left button
- tNext: 'Next (Right arrow key)', // title for right button
- tCounter: '<span class="mfp-counter">%curr% of %total%</span>' // 标记的计数器
- },
- image: {
- tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
- titleSrc: function (item) {
- return item.el.attr('title') + '<small></small>';
- }
- }
- });
- })
- //删除
- function del(obj) {
- console.log(obj)
- layer.confirm('是否删除?', {
- btn: ['确定', '取消'] //可以无限个按钮
- , btn3: function (index, layero) {
- //按钮【按钮三】的回调
- }
- }, function (index, layero) {
- var array = [];
- var addr = obj.parent().find('img').attr('src');
- array.push(addr);
- var imei = obj.prev().prev().val();
- layer.close(index)
- $.ajax({
- url: 'jkimage_del',
- type: 'post',
- data: {
- addr: addr,
- // addr: array,
- imei: imei
- },
- success: function (data) {
- if (data) {
- $.ajax({
- url: 'jk_image',
- type: 'post',
- data:{
- imei:$('#imei').val(),
- page:$('.layui-laypage-curr em').eq(1).html()
- },
- success: function (data) {
- $('#imgList').html('');
- $('#imgList').html(data);
- if ($('.content').height() > 750) {
- $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
- } else {
- $('#iframe-main', parent.document).css('height', '750px')
- }
- }
- })
- } else {
- alert('删除失败')
- }
- }
- })
- }, function (index) {
- //按钮【按钮二】的回调
- });
- }
|