You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.6 KiB
JavaScript
64 lines
2.6 KiB
JavaScript
6 years ago
|
// city tour list
|
||
|
//切换左边的菜单
|
||
|
function Togle(obj,id){
|
||
|
var mObj = $(obj);
|
||
|
var sObj = $("#"+id);
|
||
|
if(sObj.is(":hidden")){
|
||
|
sObj.slideDown("slow");
|
||
|
mObj.removeClass("filtercategoryclose").addClass("filtercategory");
|
||
|
}else{
|
||
|
sObj.slideUp("slow");
|
||
|
mObj.removeClass("filtercategory").addClass("filtercategoryclose");
|
||
|
}
|
||
|
}
|
||
|
function Select(e){
|
||
|
var clickObj = $(e);
|
||
|
clickObj.siblings().attr("className","unselect2").end().attr("className","select2");
|
||
|
}
|
||
|
$(document).ready(function(){
|
||
|
$("#sortCities dl dt").click(function(){
|
||
|
Select(this);
|
||
|
})
|
||
|
|
||
|
$("#tourfilterResult0 .daytripList.tourfilterList").each(function(i){
|
||
|
var tempurl = $(this).find("H2 a").attr("href");
|
||
|
$.ajax({
|
||
|
url: tempurl, cache: true,
|
||
|
success: function(data){
|
||
|
$(".daytripList.tourfilterList").each(function(){
|
||
|
var tempid = $.trim($(data).find("#contentHead h1").text().toLowerCase());
|
||
|
var tempTourtitle = $.trim($(this).find("h2 a").text().toLowerCase());
|
||
|
|
||
|
if (tempid == tempTourtitle ){
|
||
|
$(this).find(".morePhotos").html("");
|
||
|
var tmppic = "";
|
||
|
var reTest = /\-s\.jpg/;
|
||
|
$(data).find(".imgdivlist").each(function(m,t){
|
||
|
var temphref = $(this).find("a").attr("href");
|
||
|
//alert(temphref);
|
||
|
if(reTest.test(temphref)){
|
||
|
temphref = temphref.replace("-s.jpg", "-m.jpg");
|
||
|
}else{
|
||
|
if (typeof(temphref) != "undefined")
|
||
|
temphref = temphref.replace(".jpg", "-m.jpg");
|
||
|
}
|
||
|
$(this).find("a").attr("href", temphref );
|
||
|
$(this).find("img").removeAttr("align");
|
||
|
$(this).find("img").removeAttr("style");
|
||
|
tmppic += $(this).html();
|
||
|
});
|
||
|
|
||
|
$(this).find(".morePhotos").html(tmppic);
|
||
|
$(this).find(".morePhotos div").remove();
|
||
|
var morePhotocount = $(this).find(".morePhotos a").size() ;
|
||
|
if (morePhotocount > 5){
|
||
|
$(this).find(".morePhotos a").hide();
|
||
|
for(var ii=0; ii < 5;ii++){$(this).find(".morePhotos a").eq(ii).show();}
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
});
|