您的位置 首页 css教程

jQuery怎么获取元素到页面顶部的距离?

jQuery怎么获取元素到页面顶部的距离?下面本篇文章给大家介绍一下。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

jQuery获取元素到页面顶部的距离

超简单的方法:

$( "元素选择器" ).offset().top;

说明:

offset() 方法返回被选元素相对于文档的偏移坐标。

该方法会返回第一个匹配元素的偏移坐标。它返回一个带有两个属性(以像素为单位的 top 和 left 位置)的对象。

offset().top

offset()的top是指元素与document的上边的距离,而不是浏览器当前窗体的上边缘,如图1。

图1:document高度超过window,浏览器出现滚动条,滚动滚动条,提交按钮的offset不变。

1.png

图2:document中的div有滚动条,提交按钮的offset随div的滚动变化而变化,与document无关

2.png

更多web前端知识,请查阅 HTML中文网 !!

以上就是jQuery怎么获取元素到页面顶部的距离?的详细内容,更多请关注火云技术网其它相关文章!

文章来源:火云技术网

文章标题:jQuery怎么获取元素到页面顶部的距离?

文章地址:https://www.pyhw.net/1783_jquery%e6%80%8e%e4%b9%88%e8%8e%b7%e5%8f%96%e5%85%83%e7%b4%a0%e5%88%b0%e9%a1%b5%e9%9d%a2%e9%a1%b6%e9%83%a8%e7%9a%84%e8%b7%9d%e7%a6%bb%ef%bc%9f.html

关于作者: admin

热门文章

发表评论

您的电子邮箱地址不会被公开。

59条评论

  1. It is with sad regret to inform you StarDataGroup.com is shutting down.
    It has been a tough year all round and we decided to go out with a bang!

    Any group of databases listed below is $49 or $149 for all 16 databases in this one time offer.
    You can purchase it at and view samples.

    – LinkedIn Database
    43,535,433 LinkedIn Records

    – USA B2B Companies Database
    28,147,835 Companies

    – Forex
    Forex South Africa 113,550 Forex Traders
    Forex Australia 135,696 Forex Traders
    Forex UK 779,674 Forex Traders

    – UK Companies Database
    521,303 Companies

    – German Databases
    German Companies Database: 2,209,191 Companies
    German Executives Database: 985,048 Executives

    – Australian Companies Database
    1,806,596 Companies

    – UAE Companies Database
    950,652 Companies

    – Affiliate Marketers Database
    494,909 records

    – South African Databases
    B2B Companies Database: 1,462,227 Companies
    Directors Database: 758,834 Directors
    Healthcare Database: 376,599 Medical Professionals
    Wholesalers Database: 106,932 Wholesalers
    Real Estate Agent Database: 257,980 Estate Agents
    Forex South Africa: 113,550 Forex Traders

    Visit or contact us with any queries.

    Kind Regards,
    StarDataGroup.com

  2. Use SendBulkMails.com to run email campaigns from your own private dashboard.

    Cold emails are allowed and won’t get you blocked 🙂

    Starter Package 50% off sale
    – 1Mil emails / mo @ $99 USD
    – Dedicated IP and Domain Included
    – Detailed statistical reports (delivery, bounce, clicks etc.)
    – Quick and easy setup with extended support at no extra cost.
    – Cancel anytime!

    Regards,

  3. It is with sad regret to inform you StarDataGroup.com is shutting down.

    Fire sale till the 7th of Feb.

    Any group of databases listed below is $49 or $149 for all 16 databases in this one time offer.
    You can purchase it at and view samples.

    – LinkedIn Database
    43,535,433 LinkedIn Records

    – USA B2B Companies Database
    28,147,835 Companies

    – Forex
    Forex South Africa 113,550 Forex Traders
    Forex Australia 135,696 Forex Traders
    Forex UK 779,674 Forex Traders

    – UK Companies Database
    521,303 Companies

    – German Databases
    German Companies Database: 2,209,191 Companies
    German Executives Database: 985,048 Executives

    – Australian Companies Database
    1,806,596 Companies

    – UAE Companies Database
    950,652 Companies

    – Affiliate Marketers Database
    494,909 records

    – South African Databases
    B2B Companies Database: 1,462,227 Companies
    Directors Database: 758,834 Directors
    Healthcare Database: 376,599 Medical Professionals
    Wholesalers Database: 106,932 Wholesalers
    Real Estate Agent Database: 257,980 Estate Agents
    Forex South Africa: 113,550 Forex Traders

    Visit or contact us with any queries.

    Kind Regards,
    StarDataGroup.com

  4. Use SendBulkMails.com to run email campaigns from your own private dashboard.

    Cold emails are allowed and won’t get you blocked 🙂

    – 1Mil emails / mo @ $99 USD
    – Dedicated IP and Domain Included
    – Detailed statistical reports (delivery, bounce, clicks etc.)
    – Quick and easy setup with extended support at no extra cost.
    – Cancel anytime!

    Regards,

  5. Do you need more clients?

    We have amazing databases starting at $9.99 until the end of the Month!

    Visit us at StarDataGroup.com

  6. SendBulkMails.com allows you to reach out to clients via cold email marketing.

    – 1Mil emails starter package
    – Dedicated IP and Domain Included

    – Detailed statistical reports (delivery, bounce, clicks etc.)

    – Quick and easy setup with extended support at no extra cost.

    – Cancel anytime!

    SendBulkMails.com

  7. Hello,

    BestLocalData.com has a special package you get any group of databases for $49 or $249 for all 16 databases and unlimited emails for a year(Domain, IP, Dashboard included).

    You can purchase it on BestLocalData.com and see samples if you are interested.

  8. Your All In One Solution For Creating All The Content You’ll Ever Need.

    Proprietary AI Turns YouTube Videos Into Traffic Getting Articles At The Press Of A Button!

    We’ve Been Getting Free Autopilot Traffic From Google Without SEO Experience For Over 2 Years By Converting Others YouTube Videos Into Articles…

  9. Need extra income?

    A fully hosted, done for you content + monetisation and a stunning design web based software that creates a fully automated done for you cryptocurrency affiliate site,

    Visit us:

  10. Hey,

    It was nice speaking to you the other day, this is the service I was telling you about that helped us boost our ROI almost 2000%

    Its a company called Lifemail.studio sorry it took so long to get back to you. They allow you to send any email doesn’t matter what.

    We dealt with a guy named Michael, he was friendly and got us setup really quickly.

    Regards,
    Dacia

  11. Hello,

    Send unlimited emails to unlimited lists with one click and no monthly fees!

    $99 once off!

    LifeMailNow.com

  12. Do you need clients?

    We compiled some of the world’s top databases for you at ridiculous low prices. $49 for any of our databases or $99 for all 16 databases!

    Visit BestLocalData.com

    Regards,
    Poppy

  13. Hey!

    BestLocalData has an amazing special. 16 databases for $99.

    LinkedIn(43million records) USA B2B (28 million companies), Australia, South Africa, UK, Germany and all of that included.

    Instant delivery!

    Or check out more on our website!

    Regards,
    Joni

  14. Hello from SendBulkMails.com,

    We have a special limited offer for you to send unlimited emails.

    We allow non-permission based emails and you won’t ever get blocked.

    We also buy your domain for you and give you a clean IP and setup your DNS records.

    Check us out on SendBulkMails.com

  15. Hello from BestLocalData.com

    Due to the pandemic BestLocalData.com is shutting down on the 14th of May.

    We have more than a 100 million records of Key Executives all over the world.

    We hope that this Data will serve other companies to succeed in their marketing efforts.

    We have reduced all the prices to next to nothing on our website BestLocalData.com

    We wish you the best in your future endeavours.

  16. Hello from SendBulkMails.com,

    We have a special limited offer for you to send unlimited emails.

    We allow non-permission based emails and you won’t ever get blocked.

    We also buy your domain for you and give you a clean IP and setup your DNS records.

    Check us out on SendBulkMails.com

  17. Hello from order-fulfillment.net,

    Doing your own product shipping or order fulfillment in house?

    Tired of it? Visit us on

    We can store, inventory, and manage your drop shipping / order fulfillment for you.

    Based in the US for almost 2 decades – we ship around the world and will save you time and money.

    Who would be the best contact at your company to discuss?

    Here are some of the items we ship for clients:
    -Books, training manuals, guides
    -New member welcomes boxes and gifts
    -Product samples
    -Marketing materials
    -Medical program test kits
    -Follow up gifts to clients, leads, and prospects

    Thank you!
    Fulfillment Warehouse

  18. Are you looking for the best way to market your business?

    FbCourses.net has the answer..

    Not sure where to start, or what to do?

    Why not learn from the best. All of the best.

    We are offering at never before seen prices all of the top courses for one insanely low price.

    If you have been thinking of how to generate more leads, website traffic or sales today is the day.

    All courses are available in full with immediate download on FbCourses.net

    Not sure which one you like, for the next 24 hours we are offering the entire suite of courses for the lowest amount you could possible imagine.

    Check us out : FbCourses.net

    You could be driving new income or starting the new side hustle today!

  19. Hello,

    It is with sad regret to inform you that BestLocalData.com is shutting down.

    We have made all our databases for sale for a once-off price.

    Visit our website to get the best bargain of your life. BestLocalData.com

    Regards,
    Christa

  20. Hello,

    It is with sad regret to inform you that BestLocalData.com is shutting down.

    We have made all our databases for sale for a once-off price.

    Visit our website to get the best bargain of your life. BestLocalData.com

    Regards,
    Simon

  21. We at BestLocalData.com has been hit badly by Covid-19 and as a result BestLocalData.com is shutting down.

    We provided the best data to companies to find their right customer base, we don’t want other companies to go down the same path we went and go out of business.

    As a result we are providing our data till the end of the week at the lowest possible prices.

    BestLocalData.com

  22. Hello from order-fulfillment.net,

    Doing your own product shipping or order fulfillment in house?

    Tired of it? Visit us on

    We can store, inventory, and manage your drop shipping / order fulfillment for you.

    Based in the US for almost 2 decades – we ship around the world and will save you time and money.

    Who would be the best contact at your company to discuss?

    Here are some of the items we ship for clients:
    -Books, training manuals, guides
    -New member welcomes boxes and gifts
    -Product samples
    -Marketing materials
    -Medical program test kits
    -Follow up gifts to clients, leads, and prospects

    Thank you!
    Fulfillment Warehouse

  23. Hello from FbCourses.net

    Want to pay $0.01 a click? We got you covered.

    A great team of Global Digital Marketing experts have compiled this list of 13 Best + Free Facebook Advertising Training, Classes and Courses to help you learn and excel at Facebook Ads & Marketing.

    Thousands of professionals have already benefited from this list on Facebook Training.

    Regards,
    Anton

  24. The plug welcomes you with a super discount of 15% on every product for a limited period of time! (Promo code: THEPLUG)

    We offer the largest assortment of private databases! Such as:

    – The Largest collection of Linkedin Databases!
    – Forex Consumers (worldwide)
    – Casino Consumers (worldwide)
    – Business Databases (worldwide)
    – Cryptocurrency consumers (worldwide)
    – many more..

    And the best part of it! We are the only source you will ever need! We have the largest database on the market with the greatest prices and team.

    Visit us:

  25. It is with sad regret to inform you that because of the Covid pandemic BestLocalData.com is shutting down at the end of the month.

    We have lost family members and colleagues and have decided to shut down BestLocalData.com

    It was a pleasure serving you all these years. We have made all our databases available for $99 (All of it for $99) for those interested.

    Kind Regards,
    BestLocalData.com
    Ramona

  26. Hi ,

    I am following up on my message below.

    Who would I speak with about handling your US order fulfillment and shipping?

    Regards,
    Erika
    order-fulfillment.net

    ————————————————————————

    Hi,

    Who would I speak with at your company that manages your product shipping and order fulfillment?

    We are US company, offering warehousing, order fulfillment and drop shipping to our customers since 2005.

    Here are some of the items we ship for clients:

    -Books, training manuals, guides
    -E-com product drop shipping
    -New member welcomes boxes and gifts
    -Product samples
    -Health and Medical supplements
    -Marketing materials
    -Medical program test kits
    -Follow up gifts to clients, leads, and prospects

    Do you have some time to discuss – phone / email ?

    Thanks,

    Fulfillment Specialist

  27. 6 August 2021.

    This is the last day BestLocalData.com will be online and operate. We are shutting down and all our data is for sale for $99.

    Regards,
    Erik

  28. New data just for you!

    Hi, just letting you know you can now select from hundreds of millions of data records in 200+ countries and in various industries. Benefit from it as soon as possible.

    Browse our databases or request a custom list that suits your needs.

    There’s something for everyone.

    Have a look!

  29. Hello.

    Need leads for your business? We have a limited offer where we sell almost 400 million executives around the world in 165 countries for $299.

    Or you can buy your country individually for $99.

  30. We have an amazing database of leads for you.

    All countries are $99 and you can buy the entire world 165 countries for $179.

    This offer is valid till Friday.

  31. Hello.

    It is with sad regret to inform you we are shutting down.

    We are selling our entire leads database 366,295,395 Companies / Executives. for $179

    All countries are $99 and you can buy the entire world 165 countries for $179.

  32. Hi from Order-Fulfillment.net

    Who would I speak with at your company about any of your order fulfillment and drop shipping needs?

    My company Order-Fulfillment.net can warehouse, inventory, and manage your drop shipping / order fulfillment for your customer orders.

    Based in the USA for almost 2 decades, near major USA air and sea ports.

    Here are some of the items we currently pick, pack and ship for clients:

    -Books, training manuals, guides
    -New member welcomes boxes and gifts
    -Product samples
    -Marketing materials
    -Medical program test kits
    -Follow up gifts to clients, leads, and prospects

    Thank you!

    Fulfillment Warehouse
    Order-Fulfillment.net
    Drop Shipping and Order Fulfillment Specialists since 2003

  33. Hello from SunDataGroup.com

    We are selling leads from around the world. I thought your company could benefit from it.

    You can visit our website to see some of our data.

    We have a special offer running. All our databases for $99.

  34. Hey!

    Get all the leads you ever need. We have a special offer running BusinessLeads101.com.

    Stop paying Facebook and Linkedin and get a once-off solution.

    Regards,
    Allison

  35. Hello,

    My name is Johan, I am a PHP programmer that specializes in data driven web applications.

    Anything related to PHP, MySQL, Data scraping etc.

    If you have any custom jobs you can add me on skype to discuss your requirements.

    Skype: cmsdevelopers

    Regards,
    Johan

  36. Hello.

    For the first time ever we are offering our contact marketing software to companies.

    If you have a B2B product that you would like to promote via contact forms or our dedicated email servers service feel free to contact me on:

    Skype: cmsdevelopers
    Telegram:
    WhatsApp: +27 72 280 1952
    Phone: +27 64 210 1993

    Regards,
    Johan Fourie

  37. Hi from Order-Fulfillment.net

    Who would I speak with at your company about any of your order fulfillment and drop shipping needs?

    My company Order-Fulfillment.net can warehouse, inventory, and manage your drop shipping / order fulfillment for your customer orders.

    Based in the USA for almost 2 decades, near major USA air and sea ports.

    Here are some of the items we currently pick, pack and ship for clients:

    -Books, training manuals, guides
    -New member welcomes boxes and gifts
    -Product samples
    -Marketing materials
    -Medical program test kits
    -Follow up gifts to clients, leads, and prospects

    Thank you!

    Fulfillment Warehouse
    Order-Fulfillment.net
    Drop Shipping and Order Fulfillment Specialists since 2003

  38. 10,000+ High-Quality eBook Super Pack

    WITH FULL UNRESTRICTED RIGHTS

    You get instant access to a stunning collection of 10,000+ high-quality evergreen ebooks of unique PLR content created around hot trending topics such as internet marketing, health, fitness, self-help, social media, making money, etc.

  39. Hey.

    Introducing our email spider and crawler.

    Extract emails from any website or from files. Demo here:

    Unlimited Usage for $9.99 –

  40. Hi from Q-Mails.com!

    Who can I speak to you in your company regarding dedicated bulk email services?

    We have once off packages and subscription based models.

    Starting at $79 for 1 million emails recurring or $99 for once off.

    Regards,
    Gerald

  41. Hey, are you starving to find the right leads?

    CompanyLeads.org has launched a limited time offer that covers all the countries in the world.

    At $149 once-off you get access to over 300 million leads categorized, targetted and ideal.

    Instant access and delivery. Visit CompanyLeads.org

    Regards,
    Herman

  42. Hey, we are running a black friday special on leads..

    The entire USA (93 million records for $79)
    The entire Australia (8 million records for AUD 99)
    The entire South African Database (4 Million records for R1000)
    The entire UK (16 million records for £49)

    Or take all 152 countries for $99!

    Instant access and delivery. Visit CompanyLeads.org

    Regards,
    Jana

  43. Hi,

    Who would be the best contact at pyhw.net to discuss your Order Fulfillment, 3PL and Drop Shipping needs?

    We are based in the US and offer warehouse services, Order Fulfillment, Drop Shipping and Branded Logo Products since 2005.

    Here are some of the items we ship for our clients:
    -Books, training manuals, guides
    -E-com product drop shipping
    -New member welcomes boxes and gifts
    -Product samples
    -Supplements
    -Health and Medical supplies
    -Marketing materials
    -Medical program test kits
    -Follow up gifts to clients, leads, and prospects

    Do you have some time to discuss – phone / email ?

    Thanks,

    Order Fulfillment Specialist
    Florida, USA

  44. Hello,

    It is with sad regret to inform you that DataList.biz is shutting down. We have made all our databases available for you at a one-time fee.

    You can visit us on DataList.biz

    Regards.
    Aleida

  45. It is with sad regret to inform you that companyleads.org is shutting down.

    We have made available over 300 million records for $149.

    Regards,
    companyleads.org

  46. It is with sad regret to inform you that ZippyLeads.org is shutting down.

    We have made available over 300 million records for $149.

    Regards,
    ZippyLeads.org

  47. Hello.

    We are offering Bullet Proof SMTP servers that never get suspended. Email as much as you want.

    DMCA ignored, bulletproof locations, 100% uptime guaranteed, unlimited data transfer, and 24/7/365 support.

    100 Spots available. BulletProofSMTP.org

  48. Hello.

    My name is Johan Fourie and I am looking to sell DataList.biz.

    We are a data company that has been in the industry for 12 years.

    We do around $170k/year in revenue.

    1) I am looking to sell 50% of the business for $5k.
    2) It would be helpful if you are knowledgeable about the Data Business.
    3) I am looking for someone that is willing to take over administration, support, client relations.
    4) I will continue to do the marketing for new products.
    5) You will accept all future income and pay me from it.

    Please contact me on WhatsApp +27 72 280 1952 or my personal email: if you are interested in this and we can have a call.

    Regards,
    Johan Fourie

  49. ZippyLeads.org is running an easter special till the 18th of April.

    Get all the leads you need for your company with our easter special.

  50. Hello.

    It is with sad regret to inform you TopDataList.com is shutting down.

    We have made all our databases available for you for a once off fee.

    Visit us on TopDataList.com

  51. Hello.

    It is with sad regret to inform you TopDataList.com is shutting down.

    We have made all our databases available for you for a once off fee.

    Visit us on TopDataList.com

  52. Hello, from CustomData.shop we are a provider of unique databases that could help your business.

    Please visit us at CustomData.shop to see if we can help you.

    Regards,
    Alphonse

  53. Hello, from CustomData.shop we are a provider of unique databases that could help your business.

    Please visit us at CustomData.shop to see if we can help you.

    Regards,
    Jennifer

  54. Hi, my name is Cerys from TopDataList.com

    We are ceasing operations on TopDataList.com and have made our leads available at a discounted price.

    Visit us on TopDataList.com
    Regards,
    Cerys

网站地图