weixin_33699914 2018-01-07 21:54 采纳率: 0%
浏览 24

Ajax-图片加载

I'm trying to create a function that shows the images from a html page when I select the categories on html page. This is the function that I created:

.js file

function getWorksContent(cat){
    var _category = cat;
    if (worksContentGot == 0) {
        $.ajax({
            type : 'POST',
            url  : '/images.html',
            data : {category : _category},
            beforeSend : function(){
                worksContentGot = 1;
            },
            success : function(data){
                $(".rightSide").html(data).fadeIn('slow');
                worksContentGot = 0;
                console.log(data);
            }
        });
    }
}

This is the link for categories in html file.

<div class="worksItem anim400" data-id="1" data-top="32vh"  style="top:32vh;" data-cat="logo"><h2>Logo Tasarımı <span class="plus">+</span><span class="times">x</span></h2></div>

But I want to show spesific images for each category. How can I do this? Thanks!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大