如何使用Javascript一个接一个地分配图像? [英] How Do I Assign The Images One After Another Using Javascript?

查看:40
本文介绍了如何使用Javascript一个接一个地分配图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,

我在IIS中有4张图片或超过4张图片。

图片包含用户记录,例如手机号码,名字,姓氏等。

我想在WebPage中一个接一个地分配图像。我不想硬编码图像。保存第一张图像的所有记录后,第二张图像应显示第一张记录。

我的问题是我可以看到第二张图片的记录,但我看不到第二张图片。请帮助

请找代码:



函数GetNextRecordCollection(){

调试器;

$ .ajax({

url:'Default.aspx / GetNextRecordCollection' ,

类型:'POST',

contentType:'application / json; charset = utf-8',

dataType:json ,

成功:功能(结果){

if(result.d!=''){
调试器;

/ *转换为arrayObject * /

customerLoanOcrList = JSON.parse(result.d);

if(customerLoanOcrList!=''&& customerLoanOcrList!= null&& customerLoanOcrList.length> 0){

$('#RawImageForOCR')。attr(src,customerLoanOcrList [0] .FileName);

ocrListIndex = 0;

setFormFields(customerLoanOcrList [ocrListIndex]);

recordLength = customerLoanOcrList.length;

scrolled = minTopScroll;

if(customerLoanOcrList [ocrListIndex ] .RecordNo> 1){

scrolled = scrolled * customerLoanOcrList [ocrListIndex] .RecordNo;

}



SetInitialScroll();

}



manageOverlay(false);

}

},

错误:功能(错误){

manageOverlay(false);

alert(error.responseText);

},

async:false

} );

};



i已在Web Config中设置图像路径

< appsetting>

< add key =OCRIMAGEPATHvalue =http:// localhost / OCRIMAGES //>







在NextButton上单击

我的团队已经完成了下一步按钮。

var customerLoanOcrList;

var isAdded = saveCustomerLoanRecord();

if(isAdded == true){

ocrListIndex = ocrListIndex + 1;

if((滚动+) minTopScroll)< $(#divImage)[0] .scrollHeight)



scrolled = scrolled + minTopScroll; //$(\"#divImage\")[0].scrollHeight;



//设置下一个记录值..

if(ocrListIndex < recordLength){

setFormFields(customerLoanOcrList [ocrListIndex]);

}

else {

GetNextRecordCollection( );

}



//下一张唱片的滚动图片

$(#divImage)。动画({

scrollTop:滚动

});



此外我很困惑如何显示第二张图片???

解决方案

.ajax({

url:'Default.aspx / GetNextRecordCollection',

类型:'POST',

contentType:'appli阳离子/ json; charset = utf-8',

dataType:json,

成功:函数(结果){

if( result.d!=''){

调试器;

/ *转换为arrayObject * /

customerLoanOcrList = JSON.parse(结果.d);

if(customerLoanOcrList!=''&& customerLoanOcrList!= null&& customerLoanOcrList.length> 0){


('#RawImageForOCR')。attr(src,customerLoanOcrList [0] .FileName);

ocrListIndex = 0 ;

setFormFields(customerLoanOcrList [ocrListIndex]);

recordLength = customerLoanOcrList.length;

scrolled = minTopScroll;

if(customerLoanOcrList [ocrListIndex] .RecordNo> 1){

scrolled = scrolled * customerLoanOcrList [ocrListIndex] .RecordNo;

}



SetInitialScroll();

}



manageOverlay(false);

}

},

错误:功能(错误){

manageOverlay(false);

alert(error.responseText);

},

async:false

} );

};



i已在Web Config中设置图像路径

< appsetting>

< add key =OCRIMAGEPATHvalue =http:// localhost / OCRIMAGES //>







在NextButton上单击

我的团队已经完成了下一步按钮。

var customerLoanOcrList;

var isAdded = saveCustomerLoanRecord();

if(isAdded == true){

ocrListIndex = ocrListIndex + 1;

if((滚动+) minTopScroll)<


(#divImage)[0] .scrollHeight)



scrolled = scrolled + minTopScroll; //

Hi Team,
I have 4 images or more than four in IIS.
Images contain the user Record such as mobile Number,Firstname,lastname..etc.
I want to assign the images one after another in WebPage.I dont want to hardcode the images.After saving the all record of first image ,second image should get show with his first record.
My problem is i can see the record of second image but i cant see the second image.Kindly help
please find the code:

function GetNextRecordCollection() {
debugger;
$.ajax({
url: 'Default.aspx/GetNextRecordCollection',
type: 'POST',
contentType: 'application/json; charset=utf-8',
dataType: "json",
success: function (result) {
if (result.d != '') {
debugger;
/*getting converted into arrayObject*/
customerLoanOcrList = JSON.parse(result.d);
if (customerLoanOcrList != '' && customerLoanOcrList != null && customerLoanOcrList.length > 0) {
$('#RawImageForOCR').attr("src", customerLoanOcrList[0].FileName);
ocrListIndex = 0;
setFormFields(customerLoanOcrList[ocrListIndex]);
recordLength = customerLoanOcrList.length;
scrolled = minTopScroll;
if (customerLoanOcrList[ocrListIndex].RecordNo > 1) {
scrolled = scrolled * customerLoanOcrList[ocrListIndex].RecordNo;
}

SetInitialScroll();
}

manageOverlay(false);
}
},
error: function (error) {
manageOverlay(false);
alert(error.responseText);
},
async: false
});
};

i have set the image path in Web Config
<appsetting>
<add key="OCRIMAGEPATH" value="http://localhost/OCRIMAGES//">



On NextButton Click
on next button my team have done this.
var customerLoanOcrList;
var isAdded = saveCustomerLoanRecord();
if (isAdded == true) {
ocrListIndex = ocrListIndex + 1;
if ((scrolled + minTopScroll) < $("#divImage")[0].scrollHeight)

scrolled = scrolled + minTopScroll; //$("#divImage")[0].scrollHeight;

// Set next records values..
if (ocrListIndex < recordLength) {
setFormFields(customerLoanOcrList[ocrListIndex]);
}
else {
GetNextRecordCollection();
}

//Scroll image for next record
$("#divImage").animate({
scrollTop: scrolled
});

Further i am confused how to show second image???

解决方案

.ajax({
url: 'Default.aspx/GetNextRecordCollection',
type: 'POST',
contentType: 'application/json; charset=utf-8',
dataType: "json",
success: function (result) {
if (result.d != '') {
debugger;
/*getting converted into arrayObject*/
customerLoanOcrList = JSON.parse(result.d);
if (customerLoanOcrList != '' && customerLoanOcrList != null && customerLoanOcrList.length > 0) {


('#RawImageForOCR').attr("src", customerLoanOcrList[0].FileName);
ocrListIndex = 0;
setFormFields(customerLoanOcrList[ocrListIndex]);
recordLength = customerLoanOcrList.length;
scrolled = minTopScroll;
if (customerLoanOcrList[ocrListIndex].RecordNo > 1) {
scrolled = scrolled * customerLoanOcrList[ocrListIndex].RecordNo;
}

SetInitialScroll();
}

manageOverlay(false);
}
},
error: function (error) {
manageOverlay(false);
alert(error.responseText);
},
async: false
});
};

i have set the image path in Web Config
<appsetting>
<add key="OCRIMAGEPATH" value="http://localhost/OCRIMAGES//">



On NextButton Click
on next button my team have done this.
var customerLoanOcrList;
var isAdded = saveCustomerLoanRecord();
if (isAdded == true) {
ocrListIndex = ocrListIndex + 1;
if ((scrolled + minTopScroll) <


("#divImage")[0].scrollHeight)

scrolled = scrolled + minTopScroll; //


这篇关于如何使用Javascript一个接一个地分配图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆