Atitit. Adaptive design of the size and position of the floating image

Source: Internet
Author: User


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 ();


}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.