Atitit. Adaptive design of the size and position of the floating image
# -------- It is best to use relate to locate ..
In the middle, the size and position of the image can be relative to the table, and there is no problem with the left or havip text mask. to suspend the image, use the top:-15 negative value ,,
# -------- Floating position top problem, because of the relative height ..
I can use js to solve the problem and calculate the top negative value ..
Function iniBonusPicPostion (){
Var mainmainxTop = $ ("# mainmainx"). position (). top;
Var mainxHeight = $ ("# mainmainx"). height ();
Var hamyarHit = 0.16 * mainxHeight;
Logx ("-- mainmainxTop n hit:" + mainmainxTop + "--" + mainxHeight );
/// HamyarHit follows the negative value of 10 relateion ..
// BonusPicTop is the top point for absolute positioning.
Var bonusPicTop = mainmainxTop + mainxHeight-hamyarHit;
Logx ("-- bonusPicTop:" + bonusPicTop );
$ ("# Bonuspic" detail .css ("top", bonusPicTop );
}
Author old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://blog.csdn.net/attilax
# ----- Use is definitely difficult to locate...
A. Question about the left text of the mask ??
Use right: 5% to solve the problem. Do not use the left 55% method... jei is not very OK sometimes ..
B. Masking of havip text.
Use js to adjust the automatic height... automatically abbreviated height...
Function iniBonusPicPositionNhit (){
// Ini bonus pic height if too lower
Var bonusPicTop = $ ("# bonuspic"). position (). top;
Var bnsPicBtm = bonusPicTop + $ ("# bonuspic"). height ();
Var btnDivO5_top = $ ("# btnDivO5"). position (). top;
If (bnsPicBtm <= $ ("# btnDivO5"). position (). top ){
Logx ("-- bnsPicBtm no excel btm boder ");
Return;
}
Var excelHit = bnsPicBtm-btnDivO5_top;
$ ("# Bonuspic"). height (btnDivO5_top-$ ("# bonuspic"). position (). top-2 );
// If ($ ("# topDivO5"). height ()-5> = excelHit ){
//
// Logx ("-- topDivO5 hit> excelHit ");
// Var topDivO5_hit =$ ("# topDivO5"). height ();
// $ ("# TopDivO5"). height (topDivO5_hit-excelHit-8 );
// IniBonusPicPostion ();
// Return;
//}
// $ ("# TopDivO5"). height (5 );
// IniBonusPicPostion ();
}