Jquery 圆角在进行 ajax 调用时不起作用..任何想法
所以我一直在做一个非常简单的ajax调用来抓取我的带有一些分页的相册。在添加 ajax 调用之前,我的圆角工作正常。选择器也是正确的。我正在为我的 .load 回调做“转弯”,但我无法让它工作:s任何想法:
//Display Loading Image
function Display_Load()
{
$("#loading").fadeIn(900,0);
$("#loading").html("<img src='/images/loading.gif' />");
}
//Hide Loading Image
function Hide_Load()
{
$("#loading").fadeOut('slow');
};
function display_corners()
{
$('.album_shell li .album_photo_shell').corner("round 3px").parent().css('padding', '6px').corner("round 13px");
$('.album_photo').corner("round 5px").parent().css('padding', '4px').corner("round 6px");
};
//默认起始页结果
$("#pagination_nav li:first").css({'color' : '#FF0084'}).css({'border' : 'none'});
Display_Load();
var album_id = $(document).getUrlParam("album_id");
$("#content").load("pagination_data.php?page=1&album_id=" + album_id, Hide_Load(),display_corners());
//Pagination Click
$("#pagination_nav li").click(function(){
Display_Load();
//CSS Styles
$("#pagination_nav li")
.css({'border' : 'solid #dddddd 1px'})
.css({'color' : '#0063DC'});
$(this)
.css({'color' : '#FF0084'})
.css({'border' : 'none'});
//Loading Data
var pageNum = this.id;
$("#content").load("pagination_data.php?page=" + pageNum + "&album_id=" + album_id, Hide_Load(),display_corners());
});
So i've been doing quite a simple ajax call to grab my photo albums with some pagination. My rounded corners worked before i added the ajax calls. The selectors are correct as well. I'm doing the 'cornering' on the callback for my .load and yet i can't get it to work :s Any ideas:
//Display Loading Image
function Display_Load()
{
$("#loading").fadeIn(900,0);
$("#loading").html("<img src='/images/loading.gif' />");
}
//Hide Loading Image
function Hide_Load()
{
$("#loading").fadeOut('slow');
};
function display_corners()
{
$('.album_shell li .album_photo_shell').corner("round 3px").parent().css('padding', '6px').corner("round 13px");
$('.album_photo').corner("round 5px").parent().css('padding', '4px').corner("round 6px");
};
//Default Starting Page Results
$("#pagination_nav li:first").css({'color' : '#FF0084'}).css({'border' : 'none'});
Display_Load();
var album_id = $(document).getUrlParam("album_id");
$("#content").load("pagination_data.php?page=1&album_id=" + album_id, Hide_Load(),display_corners());
//Pagination Click
$("#pagination_nav li").click(function(){
Display_Load();
//CSS Styles
$("#pagination_nav li")
.css({'border' : 'solid #dddddd 1px'})
.css({'color' : '#0063DC'});
$(this)
.css({'color' : '#FF0084'})
.css({'border' : 'none'});
//Loading Data
var pageNum = this.id;
$("#content").load("pagination_data.php?page=" + pageNum + "&album_id=" + album_id, Hide_Load(),display_corners());
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在调用实际的函数,而不是仅传递引用。此外,您传递的是两个单独的函数,而不是仅传递
load
方法接受的一个函数。你应该把它改成这样:我会这样抽象:
You are calling the actual functions vs. just passing references. Additionally, you are passing two separate functions vs. just one that the
load
method accepts. You should change it to something like this:I would abstract it like this: