问题
我有两个按钮,显示带.orig x3000
LD R6, m48 ; ASCII char. val. - m48 = dec. int. val.
LEA R0, id ; get a horizontal line
PUTS ; print
LEA R0, numberone ; get prompt for first number
PUTS ; print
GETC ; get first number (ASCII char. val.),
; we will call this A1
OUT ; print
ADD R1, R0, 0 ; put A1 in R1
LEA R0, numbertwo ; get prompt for second number
PUTS ; print
GETC ; get second number (ASCII char. val.),
; we will call this A2
OUT ; print
ADD R2, R0, 0 ; put A2 in R2
LEA R0, line ;
PUTS ; doing some stuff here to get the output below...
ADD R0, R1, 0 ; ┌─────────────┐
OUT ; │----- │
LEA R0, display ; │A1 + A2 │
PUTS ; │answer: │
ADD R0, R2, 0 ; └─────────────┘
OUT ;
LEA R0, equalization
PUTS ;
LEA R0, result ; everything looks good so far,
PUTS ; now all we need is the answer...
ADD R0, R2, R1 ; put the sum in R0
ADD R0, R0, R6 ; subtract 48 (to get the ASCII char. val.)
; ERROR: there is no ASCII char. val. for n > 9,
; FIX:
LD R5, m57 ; get '9' == 57 (but negative, for subtraction)
ADD R1, R0, R5 ; if ((answer - '9') <= 0),
BRnz DONE ; then answer is a single digit, print
ADD R2, R0, 0 ; else store the digits in R2
LD R0, p49 ; get 1
OUT ; print
ADD R0, R2, -10 ; get the second digit
DONE OUT ; print
HALT
id .stringz "-----"
numberone .stringz "\nPlease enter first number: "
numbertwo .stringz "\nPlease enter second number: "
display .stringz " + "
line .stringz "\n-----: "
equalization .stringz "\nanswer: "
m48 .fill -48
m57 .fill -57 ; -(the ASCII code for '9')
p49 .fill 49 ; the ASCII code for '1'
result .stringz " "
.end
和data-number=10
的模态。标题更新但是当我警告数据内容时,它会显示首先单击的按钮的值。
请参阅此演示:
期望
当我点击 10 的模态按钮时,它应该提醒data-number=20
。当我点击 20
10
答案 0 :(得分:0)
更新了您的小提琴,结帐link。
我已将modal.find('#btn-demo').attr('data-number', number);
更改为modal.find('#btn-demo').data('number', number);
。
我也修复了html,.modal-sm
位置错误。它应该在.modal-dialog
级别。