有朋友問我個問題,就是一些使用者合約要看完才能繼續的功能怎麼做,想想我也沒試過,於是就來搞一下。做好的樣子就長的像下面一樣,手邊沒啥EULA所以上網找了D3的test agreement來用。
還蠻簡單的,主要就是去比較兩個Div的高度與offset來判斷是否拉到底了,程式如下:
JavaScript
CSS 可有可無
HTML
參考資料 : Is there a way to force a user to scroll to the bottom of a div?
我只有做點小小修改,基本上程式主體是一樣的。
PS:因為有用到.scroll(),所以記得要載入jquery,不然不會動的。
DIABLO III
PRE-RELEASE TESTING AGREEMENT
YOU SHOULD CAREFULLY READ THE FOLLOWING PRE-RELEASE TEST AGREEMENT (THE “AGREEMENT”) BEFORE INSTALLING THIS SOFTWARE PROGRAM. IF YOU DO NOT AGREE WITH ALL OF THE TERMS OF THIS AGREEMENT, YOU MAY NOT INSTALL THIS SOFTWARE PROGRAM.
This pre-release version of the “DIABLOR III” software program and any accompanying materials or documentation (collectively, the “Game”), is the copyrighted work of Blizzard Entertainment, Inc. (“Blizzard”), or its suppliers. All use of the Game is governed by the terms of this Agreement. This DiabloR III Pre-Release Test (the “Test”) provides a limited opportunity during which certain designated people (“Testers”) are given the opportunity to test the pre-release version of the “Game.” If you are designated by Blizzard as a Tester, then in consideration of your meeting the eligibility requirements set forth below, and agreeing and adhering to the terms and conditions of this Agreement, you will be given the opportunity to test the Game.
1. Eligibility. You are only eligible to participate in the Test if:
(i) You are designated by Blizzard as a Tester;
(ii) You have registered a Battle.netR account which is in good standing (the “Account”), and you are in full compliance with the Battle.net Terms of Use at all times during the Test;
(iii) You are an adult in your country of residence;
(iv) You allow Blizzard to obtain hardware and software information from the computer system that you will use to take part in the Test (the “System”) prior to registration for the Test in order for Blizzard to determine if you are eligible to participate in the Test; and
(v) The System meets the specifications which Blizzard determines are required for the Test.
You understand that Blizzard may change the required system specifications at any time during the Test, and if at any time during the Test your System does not meet the requirements, Blizzard, in its sole discretion, may determine that you are ineligible to continue to participate in the Test.
2. Grant of License. Blizzard grants you a license to install and use one (1) copy of the Game for your use on one (1) computer which you own or control at your place of residence for the purpose of testing the Game. This license is limited, non-exclusive, and can be revoked by Blizzard at any time, for any reason.
3. Distribution of the Game. The “Blizzard Downloader” utility utilizes the ‘upload’ capability of your computer to distribute the Game to other participants of the Test. By accepting the terms of this agreement, you agree that Blizzard may distribute the Game using the upload capacity of the System to ‘upload’ all or part of the Game to other participants of the Test.
4. Confidentiality. The existence of the Test and all elements thereof (including without limitation this Agreement) is confidential, and you agree to maintain secrecy associated with the Test. For purposes of example and not limitation, you agree that you will not disclose the following:
(i) Information about the Test, such as your role as a Tester, the length of the Test, the number of Testers, how you became a Tester, etc.
(ii) Information related to the Game, such as the Game’s look and feel, playable races, classes, combat, magic, communication, grouping, questing, monetary systems, the Game’s non-player character interaction, quests, items, armor, weapons, stability of the Game, etc.
During the Test, Blizzard can announce to Testers that certain information about the Game may be disclosed to the public. After such an announcement, you may disclose information that Blizzard has approved for public disclosure.
5. Ownership. Blizzard owns the Game, including all intellectual property rights in and to the Game and all copies thereof. The Game is protected by the copyright laws of the United States, international treaties and conventions, and other laws. The Game may contain materials licensed by third parties, and the licensors of those materials may enforce their rights in the event of any violation of this Agreement.
6. Tester Responsibilities
(i) You may not copy, photocopy, reproduce, translate, reverse engineer, derive source code from, modify, disassemble, decompile, or create derivative works based on the Game,
(ii) You may not remove any proprietary notices or labels from the Game.
(iii) Without limiting Blizzard’s rights hereunder, you agree that you shall not:
a) sell, rent, lease, lend, license the Game to others, grant a security interest in, or transfer reproductions of the Game and/or the Account to other parties, or let any third person use the Game and/or the Account;
b) exploit the Game or any of its parts for any commercial purpose;
c) host, provide or develop matchmaking services for the Game, or intercept, emulate or redirect the communication protocols used by Blizzard in any way, including without limitation, through protocol emulation, tunneling, packet sniffing, modifying or adding components to the Game, use of a utility program or any other techniques now known or hereafter developed, for any purpose, including without limitation unauthorized network play over the Internet, network play utilizing commercial or non-commercial gaming networks, or as part of content aggregation networks; or
d) facilitate, create or maintain any connection to the Game which has not been authorized by Blizzard, including without limitation any connection to any unauthorized server that emulates, or attempts to emulate, the Game.
7. Consent to Monitor. THE GAME MAY MONITOR YOUR COMPUTER’S RANDOM ACCESS MEMORY (RAM) FOR UNAUTHORIZED THIRD PARTY PROGRAMS RUNNING CONCURRENTLY WITH THE GAME. AN “UNAUTHORIZED THIRD PARTY PROGRAM” IS A THIRD PARTY SOFTWARE, SUCH AS AN “ADDON,” “MOD,” “HACK,” “TRAINER,” OR “CHEAT,” THAT: (i) ENABLES OR FACILITATES CHEATING OF ANY TYPE; (ii) ALLOWS USERS TO MODIFY OR HACK THE GAME INTERFACE, ENVIRONMENT, AND/OR EXPERIENCE; OR (iii) INTERCEPTS, “MINES,” OR OTHERWISE COLLECTS INFORMATION FROM OR THROUGH THE GAME. IF THE GAME DETECTS AN UNAUTHORIZED THIRD PARTY PROGRAM, THE GAME MAY (a) COMMUNICATE INFORMATION BACK TO BLIZZARD THAT COULD INCLUDE YOUR ACCOUNT NAME, IP ADDRESSS, DETAILS ABOUT THE UNAUTHORIZED THIRD PARTY PROGRAM DETECTED, AND THE TIME AND DATE THE UNAUTHORIZED THIRD PARTY PROGRAM WAS DETECTED; AND/OR (b) TERMINATE YOUR ACCESS TO THE TEST.
8. Termination. Blizzard may terminate this Agreement at any time, for any reason, or for no reason. Upon termination of the Agreement, you must destroy the Game and all documents and materials you received from Blizzard in connection with the Test, and remove any elements of the Game from any hard drives on which the Game has been installed.
9. Feedback. During and after the Test, Blizzard may provide you with an opportunity to provide Blizzard with comments, suggestions and impressions of the Game by using the in-program mechanisms provided to supply feedback and bug reports, internal websites and forums, and such other methods. The Game may also include a tool that will allow the System to forward system and driver information to Blizzard in the event of a crash. This tool will collect data on the System during the crash, and allow you to forward a report to Blizzard via electronic mail.
10. Acknowledgments. You that:
(i) the Game is a work in progress and may contain bugs which may cause loss of data and/or damage to the System;
(ii) you have, or will, back-up your hard drive prior to installation of the Game;
(iii) you have the resources necessary to easily reinstall your operating system and restore any and all data that may be lost;
(iv) Blizzard is not liable in any way for the loss of data or damage to the System, interruptions of service, software or hardware failures, or loss of data or disruption of service.
(v) Blizzard may monitor and record any and all communications, electronic or otherwise, pertaining to the Game including, without limitation, packets, chat, email, message board postings, etc.;
(vi) Blizzard may delete or modify the information stored by the Game for any reason at any time during the duration of the Test; and
(vii) Blizzard may transfer software program files to the System, including a program that will collect and send Blizzard CPU, RAM, operating system, video card, and sound card information from the System.
11. DISCLAIMER OF WARRANTIES. THE GAME AND ANY ACCOMPANYING DOCUMENTATION IS PROVIDED TO YOU “AS IS” WITHOUT WARRANTY OF ANY KIND. BLIZZARD DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO ANY AND ALL IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
12. LIMITATION OF LIABILITY. BLIZZARD IS NOT LIABLE TO YOU FOR ANY DAMAGES OF ANY KIND INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT, COMPENSATORY, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT AND YOUR PARTICIPATION IN THE TEST.
13. Equitable Remedies. You agree that Blizzard would be damaged if you breach the terms of sections 2,3,5,7, and 10-14 of this Agreement, and if you are in breach of one or more of these sections of the Agreement, Blizzard shall be entitled, without bond, other security, or proof of damages, to appropriate equitable remedies with respect to breaches of this Agreement, in addition to any other legal remedies available to Blizzard.
14. Miscellaneous. If the terms of this Agreement and the Battle.net Terms of Use are in conflict, the terms of this Agreement shall govern and supersede any conflicting terms found in the Battle.net Terms of Use Agreement. Blizzard reserves the right to update, modify or change this Agreement or the Terms of Use at any time, for any reason, without notice to you. This Agreement shall be deemed to have been made and executed in the State of California, and any dispute arising hereunder shall be resolved in accordance with the law of California, before a state or federal court located in the State of California, County of Los Angeles. In the event that any provision of this Agreement shall be held by a court or other tribunal of competent jurisdiction to be unenforceable, such provision will be enforced to the maximum extent permissible and the remaining portions of this Agreement shall remain in full force and effect. This Agreement constitutes and contains the entire agreement between the parties with respect to the subject matter hereof and supersedes any prior oral or written agreements.
c 2011 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are registered trademarks of Blizzard Entertainment, Inc., in the U.S. and/or other countries.
PRE-RELEASE TESTING AGREEMENT
YOU SHOULD CAREFULLY READ THE FOLLOWING PRE-RELEASE TEST AGREEMENT (THE “AGREEMENT”) BEFORE INSTALLING THIS SOFTWARE PROGRAM. IF YOU DO NOT AGREE WITH ALL OF THE TERMS OF THIS AGREEMENT, YOU MAY NOT INSTALL THIS SOFTWARE PROGRAM.
This pre-release version of the “DIABLOR III” software program and any accompanying materials or documentation (collectively, the “Game”), is the copyrighted work of Blizzard Entertainment, Inc. (“Blizzard”), or its suppliers. All use of the Game is governed by the terms of this Agreement. This DiabloR III Pre-Release Test (the “Test”) provides a limited opportunity during which certain designated people (“Testers”) are given the opportunity to test the pre-release version of the “Game.” If you are designated by Blizzard as a Tester, then in consideration of your meeting the eligibility requirements set forth below, and agreeing and adhering to the terms and conditions of this Agreement, you will be given the opportunity to test the Game.
1. Eligibility. You are only eligible to participate in the Test if:
(i) You are designated by Blizzard as a Tester;
(ii) You have registered a Battle.netR account which is in good standing (the “Account”), and you are in full compliance with the Battle.net Terms of Use at all times during the Test;
(iii) You are an adult in your country of residence;
(iv) You allow Blizzard to obtain hardware and software information from the computer system that you will use to take part in the Test (the “System”) prior to registration for the Test in order for Blizzard to determine if you are eligible to participate in the Test; and
(v) The System meets the specifications which Blizzard determines are required for the Test.
You understand that Blizzard may change the required system specifications at any time during the Test, and if at any time during the Test your System does not meet the requirements, Blizzard, in its sole discretion, may determine that you are ineligible to continue to participate in the Test.
2. Grant of License. Blizzard grants you a license to install and use one (1) copy of the Game for your use on one (1) computer which you own or control at your place of residence for the purpose of testing the Game. This license is limited, non-exclusive, and can be revoked by Blizzard at any time, for any reason.
3. Distribution of the Game. The “Blizzard Downloader” utility utilizes the ‘upload’ capability of your computer to distribute the Game to other participants of the Test. By accepting the terms of this agreement, you agree that Blizzard may distribute the Game using the upload capacity of the System to ‘upload’ all or part of the Game to other participants of the Test.
4. Confidentiality. The existence of the Test and all elements thereof (including without limitation this Agreement) is confidential, and you agree to maintain secrecy associated with the Test. For purposes of example and not limitation, you agree that you will not disclose the following:
(i) Information about the Test, such as your role as a Tester, the length of the Test, the number of Testers, how you became a Tester, etc.
(ii) Information related to the Game, such as the Game’s look and feel, playable races, classes, combat, magic, communication, grouping, questing, monetary systems, the Game’s non-player character interaction, quests, items, armor, weapons, stability of the Game, etc.
During the Test, Blizzard can announce to Testers that certain information about the Game may be disclosed to the public. After such an announcement, you may disclose information that Blizzard has approved for public disclosure.
5. Ownership. Blizzard owns the Game, including all intellectual property rights in and to the Game and all copies thereof. The Game is protected by the copyright laws of the United States, international treaties and conventions, and other laws. The Game may contain materials licensed by third parties, and the licensors of those materials may enforce their rights in the event of any violation of this Agreement.
6. Tester Responsibilities
(i) You may not copy, photocopy, reproduce, translate, reverse engineer, derive source code from, modify, disassemble, decompile, or create derivative works based on the Game,
(ii) You may not remove any proprietary notices or labels from the Game.
(iii) Without limiting Blizzard’s rights hereunder, you agree that you shall not:
a) sell, rent, lease, lend, license the Game to others, grant a security interest in, or transfer reproductions of the Game and/or the Account to other parties, or let any third person use the Game and/or the Account;
b) exploit the Game or any of its parts for any commercial purpose;
c) host, provide or develop matchmaking services for the Game, or intercept, emulate or redirect the communication protocols used by Blizzard in any way, including without limitation, through protocol emulation, tunneling, packet sniffing, modifying or adding components to the Game, use of a utility program or any other techniques now known or hereafter developed, for any purpose, including without limitation unauthorized network play over the Internet, network play utilizing commercial or non-commercial gaming networks, or as part of content aggregation networks; or
d) facilitate, create or maintain any connection to the Game which has not been authorized by Blizzard, including without limitation any connection to any unauthorized server that emulates, or attempts to emulate, the Game.
7. Consent to Monitor. THE GAME MAY MONITOR YOUR COMPUTER’S RANDOM ACCESS MEMORY (RAM) FOR UNAUTHORIZED THIRD PARTY PROGRAMS RUNNING CONCURRENTLY WITH THE GAME. AN “UNAUTHORIZED THIRD PARTY PROGRAM” IS A THIRD PARTY SOFTWARE, SUCH AS AN “ADDON,” “MOD,” “HACK,” “TRAINER,” OR “CHEAT,” THAT: (i) ENABLES OR FACILITATES CHEATING OF ANY TYPE; (ii) ALLOWS USERS TO MODIFY OR HACK THE GAME INTERFACE, ENVIRONMENT, AND/OR EXPERIENCE; OR (iii) INTERCEPTS, “MINES,” OR OTHERWISE COLLECTS INFORMATION FROM OR THROUGH THE GAME. IF THE GAME DETECTS AN UNAUTHORIZED THIRD PARTY PROGRAM, THE GAME MAY (a) COMMUNICATE INFORMATION BACK TO BLIZZARD THAT COULD INCLUDE YOUR ACCOUNT NAME, IP ADDRESSS, DETAILS ABOUT THE UNAUTHORIZED THIRD PARTY PROGRAM DETECTED, AND THE TIME AND DATE THE UNAUTHORIZED THIRD PARTY PROGRAM WAS DETECTED; AND/OR (b) TERMINATE YOUR ACCESS TO THE TEST.
8. Termination. Blizzard may terminate this Agreement at any time, for any reason, or for no reason. Upon termination of the Agreement, you must destroy the Game and all documents and materials you received from Blizzard in connection with the Test, and remove any elements of the Game from any hard drives on which the Game has been installed.
9. Feedback. During and after the Test, Blizzard may provide you with an opportunity to provide Blizzard with comments, suggestions and impressions of the Game by using the in-program mechanisms provided to supply feedback and bug reports, internal websites and forums, and such other methods. The Game may also include a tool that will allow the System to forward system and driver information to Blizzard in the event of a crash. This tool will collect data on the System during the crash, and allow you to forward a report to Blizzard via electronic mail.
10. Acknowledgments. You that:
(i) the Game is a work in progress and may contain bugs which may cause loss of data and/or damage to the System;
(ii) you have, or will, back-up your hard drive prior to installation of the Game;
(iii) you have the resources necessary to easily reinstall your operating system and restore any and all data that may be lost;
(iv) Blizzard is not liable in any way for the loss of data or damage to the System, interruptions of service, software or hardware failures, or loss of data or disruption of service.
(v) Blizzard may monitor and record any and all communications, electronic or otherwise, pertaining to the Game including, without limitation, packets, chat, email, message board postings, etc.;
(vi) Blizzard may delete or modify the information stored by the Game for any reason at any time during the duration of the Test; and
(vii) Blizzard may transfer software program files to the System, including a program that will collect and send Blizzard CPU, RAM, operating system, video card, and sound card information from the System.
11. DISCLAIMER OF WARRANTIES. THE GAME AND ANY ACCOMPANYING DOCUMENTATION IS PROVIDED TO YOU “AS IS” WITHOUT WARRANTY OF ANY KIND. BLIZZARD DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO ANY AND ALL IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
12. LIMITATION OF LIABILITY. BLIZZARD IS NOT LIABLE TO YOU FOR ANY DAMAGES OF ANY KIND INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT, COMPENSATORY, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT AND YOUR PARTICIPATION IN THE TEST.
13. Equitable Remedies. You agree that Blizzard would be damaged if you breach the terms of sections 2,3,5,7, and 10-14 of this Agreement, and if you are in breach of one or more of these sections of the Agreement, Blizzard shall be entitled, without bond, other security, or proof of damages, to appropriate equitable remedies with respect to breaches of this Agreement, in addition to any other legal remedies available to Blizzard.
14. Miscellaneous. If the terms of this Agreement and the Battle.net Terms of Use are in conflict, the terms of this Agreement shall govern and supersede any conflicting terms found in the Battle.net Terms of Use Agreement. Blizzard reserves the right to update, modify or change this Agreement or the Terms of Use at any time, for any reason, without notice to you. This Agreement shall be deemed to have been made and executed in the State of California, and any dispute arising hereunder shall be resolved in accordance with the law of California, before a state or federal court located in the State of California, County of Los Angeles. In the event that any provision of this Agreement shall be held by a court or other tribunal of competent jurisdiction to be unenforceable, such provision will be enforced to the maximum extent permissible and the remaining portions of this Agreement shall remain in full force and effect. This Agreement constitutes and contains the entire agreement between the parties with respect to the subject matter hereof and supersedes any prior oral or written agreements.
c 2011 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are registered trademarks of Blizzard Entertainment, Inc., in the U.S. and/or other countries.
還蠻簡單的,主要就是去比較兩個Div的高度與offset來判斷是否拉到底了,程式如下:
JavaScript
<script type="text/javascript" language="javascript"> $(document).ready(function(){ $(".OuterDiv").scroll(function () { var outerDiv = $(this); var innerDiv = $(">.InnerDiv", $(this)); var ScrollMod = 1; if (outerDiv.offset().top < innerDiv.outerHeight()) { ScrollMod = -1; } if (Math.round((ScrollMod * innerDiv.offset().top) + outerDiv.height() + outerDiv.offset().top) >= innerDiv.outerHeight() && Math.abs(innerDiv.offset().top) != 0) { $(".CheckBox input").attr("disabled", false); $(this).unbind("scroll"); } else { $(".CheckBox input").attr("disabled", true); } }); }); </script>
CSS 可有可無
<style type='text/css'> .OuterDiv { float: left; width: 780px; height: 300px; overflow: auto;} .InnerDiv { float: left; color:gray; } </style>
HTML
<div class="OuterDiv"> <div class="InnerDiv"> 很長的使用者合約... </div> </div> <span class="CheckBox"> <input id="MainContent_CheckBox" type="checkbox" disabled="disabled" /> <label for="MainContent_CheckBox">我已經讀過並同意以上使用者條約。</label> </span>
參考資料 : Is there a way to force a user to scroll to the bottom of a div?
我只有做點小小修改,基本上程式主體是一樣的。
PS:因為有用到.scroll(),所以記得要載入jquery,不然不會動的。
No comments:
Post a Comment