偶遇,侧边栏拖拽式效果,用最少的代码实现

福尔摩斯对我笑 2019-02-18 17235 次 1334条

<html>
<head>
<meta charset="utf-8">
<title>echarts使用一</title>
<script src="js/echarts.js"></script>
<script src="js/china.js"></script>
<script src="js/china-city.js"></script>

</head>
<body>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="main" style="width: 100%;height:1000px;"></div>

<div id="onlineInfo">
    <h3>Pages</h3>
    <ul>
        <li>xxxxxxxxx</li>
        <li>xxxxxxxxxxxxxx</li>
    </ul>
</div>

<script>



 window.onload = function()
 {
  var div1 = document.getElementById("onlineInfo");
  div1.onmousedown = function(ev){
    var oevent = ev || event;

    var distanceX = oevent.clientX - div1.offsetLeft;
    var distanceY = oevent.clientY - div1.offsetTop;

    document.onmousemove = function(ev){
      var oevent = ev || event;
      div1.style.left = oevent.clientX - distanceX + 'px';
      div1.style.top = oevent.clientY - distanceY + 'px'; 
    };
    document.onmouseup = function(){
      document.onmousemove = null;
      document.onmouseup = null;
    };
  
         }
}

</script>

<style>
    *{
        margin: 0;
        padding: 0;
    }
    #onlineInfo{
        border:1px solid #cdcdcd;
        background-color: #3e3e3e;
        padding: 10px;
        position: absolute;
        top: 18%;
        right: 2%;
        border-radius: 4px;
    }

    #onlineInfo h3{
        font-weight: bold;
        font-size: 20px;
        text-align: center;
        border-radius: 4px;
        background-color: #323232;
        color: #f1f1f1;
        padding: 4px 0;
    }
    #onlineInfo ul {
        background-color: #1d1d1d;
        max-width: 200px;
        word-break: break-all;
    }
    #onlineInfo ul li{
        list-style-type: none;
        padding: 0 4px;
        color: #fff;
        line-height: 30px;
        font-size: 16px;
    }


</style>
</body>
</html>
JS Bin on jsbin.com
标签:

非特殊说明,本博所有文章均为博主原创。

头像也是LOGO
未来博客 博主大人
到了这个年纪,不应该再彷徨!

发表评论



 


已有 1334 条评论 1


  1. yeezy shoes

    I simply needed to thank you very much yet again. I’m not certain the things I would’ve achieved in the absence of the actual creative concepts shown by you relating to my industry. It actually was a real frightful issue in my circumstances, nevertheless noticing a new expert form you processed it took me to jump with joy. Now i’m happy for this help as well as sincerely hope you comprehend what a powerful job you were providing educating some other people using your web blog. I am sure you have never come across all of us.

    回复 2019年10月28日
  2. jordan shoes

    Thanks so much for giving everyone such a nice chance to check tips from this web site. It is usually so nice and jam-packed with a good time for me personally and my office peers to search your website nearly thrice per week to learn the fresh secrets you will have. And definitely, I am also usually amazed with the fabulous inspiring ideas served by you. Certain 4 tips in this post are really the very best we have had.

    回复 2019年10月28日
  3. nfl jerseys

    I must convey my appreciation for your kind-heartedness supporting men and women that should have assistance with your subject. Your personal dedication to passing the solution throughout has been amazingly interesting and have usually permitted girls much like me to arrive at their desired goals. Your invaluable publication indicates a lot a person like me and a whole lot more to my peers. Warm regards; from all of us.

    回复 2019年10月27日
  4. off white nike

    My wife and i were more than happy when Chris managed to deal with his investigation with the precious recommendations he discovered in your web page. It is now and again perplexing just to continually be handing out information and facts that many men and women have been making money from. We remember we have the writer to give thanks to because of that. Most of the explanations you made, the easy site navigation, the friendships you can aid to instill – it’s got everything overwhelming, and it’s really assisting our son and our family imagine that this subject matter is satisfying, which is certainly highly vital. Thank you for the whole lot!

    回复 2019年10月27日
  5. off-white

    I together with my pals were found to be looking through the nice ideas found on the website while all of a sudden got a terrible feeling I never thanked you for those techniques. Most of the people happened to be as a result warmed to study them and now have honestly been using those things. We appreciate you turning out to be indeed considerate and also for opting for variety of cool topics most people are really wanting to know about. My honest regret for not expressing gratitude to you earlier.

    回复 2019年10月27日
  6. curry 5

    I needed to create you that very small word just to say thanks the moment again for all the amazing views you have shared in this article. This has been really extremely generous with people like you to grant unreservedly precisely what a few individuals could have supplied as an ebook to help with making some money on their own, mostly since you might have done it in case you wanted. The secrets likewise acted like a good way to recognize that other people have the identical keenness just as my personal own to understand good deal more concerning this issue. I think there are numerous more fun instances up front for people who look into your blog.

    回复 2019年10月26日
  7. supreme clothing

    I enjoy you because of your entire labor on this website. My daughter loves engaging in internet research and it’s really obvious why. Almost all learn all concerning the dynamic means you convey effective items through the web blog and as well strongly encourage participation from people on the idea plus my child is in fact being taught a lot. Enjoy the remaining portion of the new year. You are carrying out a really great job.

    回复 2019年10月26日
  8. nike air max shoes

    I and my friends have already been taking note of the great pointers on your web blog and so all of the sudden got an awful suspicion I never expressed respect to the web blog owner for those secrets. All of the ladies are already as a result thrilled to learn them and now have sincerely been taking pleasure in these things. Thanks for simply being indeed kind as well as for considering certain essential guides most people are really desirous to learn about. Our honest apologies for not expressing appreciation to earlier.

    回复 2019年10月25日
  9. nike air max 97

    I have to point out my love for your generosity in support of those people who absolutely need help with your issue. Your real commitment to passing the solution all through turned out to be definitely advantageous and have in every case permitted some individuals much like me to realize their goals. This insightful instruction indicates a whole lot a person like me and especially to my office colleagues. Thanks a ton; from everyone of us.

    回复 2019年10月25日
  10. moncler jacket

    My husband and i got quite comfortable Ervin managed to conclude his reports using the precious recommendations he came across through your site. It is now and again perplexing just to always be making a gift of guidance which often men and women could have been making money from. So we acknowledge we now have the writer to be grateful to because of that. The entire explanations you have made, the simple web site menu, the relationships your site help engender – it’s got all incredible, and it’s really leading our son and our family do think this content is enjoyable, and that’s rather fundamental. Thanks for the whole lot!

    回复 2019年10月25日
  11. yeezy boost

    I simply wished to thank you so much yet again. I am not sure the things that I could possibly have tried without the actual creative concepts discussed by you regarding that area. Entirely was the challenging matter in my view, however , being able to see the very well-written tactic you resolved the issue forced me to jump over joy. I’m just happy for the advice and have high hopes you are aware of a powerful job you happen to be getting into teaching the others via your webpage. I know that you have never met any of us.

    回复 2019年10月25日
  12. kd shoes

    Thanks so much for giving everyone an exceptionally terrific possiblity to read in detail from this website. It can be very beneficial and also stuffed with a lot of fun for me and my office colleagues to search the blog at the least three times in 7 days to read through the fresh stuff you have got. Of course, I am certainly satisfied concerning the great tactics served by you. Selected 4 ideas in this article are absolutely the most impressive we have ever had.

    回复 2019年10月24日
  13. kyrie shoes

    Thank you so much for providing individuals with such a pleasant opportunity to read in detail from here. It’s usually so ideal plus packed with a great time for me personally and my office co-workers to visit your blog the equivalent of thrice in one week to find out the fresh tips you will have. And definitely, I’m so always impressed with the astounding tips and hints served by you. Certain 3 points in this post are clearly the most impressive we’ve had.

    回复 2019年10月24日
  14. paul george shoes

    I wish to show some appreciation to you for bailing me out of this difficulty. After scouting throughout the the net and getting strategies which are not powerful, I believed my entire life was over. Living without the approaches to the difficulties you’ve fixed as a result of this posting is a critical case, and the ones which might have negatively damaged my career if I hadn’t discovered your website. Your own talents and kindness in maneuvering the whole thing was helpful. I’m not sure what I would’ve done if I hadn’t encountered such a stuff like this. It’s possible to at this time look ahead to my future. Thank you very much for this impressive and results-oriented help. I will not be reluctant to refer the sites to any individual who would need care about this issue.

    回复 2019年10月24日
  15. nike air max

    My husband and i have been quite delighted that Louis could complete his investigation through the precious recommendations he grabbed in your web site. It’s not at all simplistic just to continually be releasing concepts which usually the rest might have been trying to sell. So we keep in mind we’ve got the writer to appreciate because of that. All the illustrations you made, the straightforward web site navigation, the friendships your site make it possible to engender – it’s mostly unbelievable, and it is making our son in addition to us reckon that that theme is amusing, and that is exceptionally fundamental. Thank you for the whole thing!

    回复 2019年10月24日
  16. yeezy boost

    I have to get across my love for your generosity supporting folks who really need help with the area. Your special dedication to passing the solution all around appeared to be rather effective and have surely encouraged those just like me to achieve their dreams. Your new invaluable useful information implies much to me and far more to my colleagues. Thank you; from all of us.

    回复 2019年10月23日
  17. louboutin shoes

    I wish to show appreciation to you for bailing me out of this particular setting. Just after surfing around throughout the internet and coming across basics which are not pleasant, I thought my life was gone. Existing minus the approaches to the difficulties you have solved as a result of your website is a critical case, as well as those which may have negatively affected my career if I hadn’t noticed your website. Your good knowledge and kindness in handling all areas was vital. I don’t know what I would’ve done if I hadn’t encountered such a step like this. I am able to now relish my future. Thanks a lot so much for your high quality and effective guide. I will not hesitate to suggest the sites to any individual who would need tips about this topic.

    回复 2019年10月23日
  18. christian louboutin shoes

    I would like to convey my passion for your kindness in support of men and women that actually need guidance on this important concept. Your real commitment to getting the solution across ended up being exceedingly interesting and have continually allowed girls just like me to attain their pursuits. The invaluable help and advice means a lot to me and far more to my colleagues. With thanks; from all of us.

    回复 2019年10月22日
  19. jordan shoes

    I truly wanted to type a small word in order to appreciate you for all the great ideas you are sharing here. My extended internet lookup has finally been honored with awesome know-how to go over with my partners. I ‘d assert that many of us website visitors are very much endowed to dwell in a fabulous community with so many awesome people with valuable secrets. I feel somewhat privileged to have come across your entire webpages and look forward to tons of more excellent times reading here. Thank you again for everything.

    回复 2019年10月21日
  20. hermes belt

    I in addition to my pals have already been going through the best tactics on your web site then suddenly developed a horrible suspicion I had not expressed respect to you for those secrets. Most of the young men are already for that reason joyful to learn all of them and have now truly been enjoying these things. Appreciation for actually being so thoughtful and for using such impressive topics millions of individuals are really eager to learn about. My personal sincere regret for not expressing gratitude to sooner.

    回复 2019年10月20日
  21. yeezy shoes

    I simply needed to thank you very much yet again. I am not sure what I would’ve tried in the absence of the entire ways contributed by you about this topic. Previously it was a very hard difficulty for me, nevertheless witnessing the professional fashion you managed that took me to weep over joy. I’m happier for your service and even pray you recognize what a powerful job you’re carrying out educating people today through the use of your blog post. I’m certain you have never met any of us.

    回复 2019年10月19日
  22. kobe 11

    I am glad for commenting to make you understand of the incredible experience my cousin’s princess gained using your webblog. She even learned lots of pieces, not to mention what it is like to have an ideal helping heart to get a number of people very easily gain knowledge of selected very confusing topics. You actually surpassed my expected results. Many thanks for supplying such insightful, dependable, edifying and cool guidance on that topic to Emily.

    回复 2019年10月18日
  23. birkin bag

    I enjoy you because of all your valuable work on this blog. My daughter takes pleasure in going through research and it is obvious why. All of us know all concerning the powerful tactic you convey invaluable strategies through the web site and as well improve participation from some other people on the matter and our simple princess is actually being taught a lot of things. Take advantage of the remaining portion of the year. You are doing a powerful job.

    回复 2019年10月17日
  24. off white shoes

    I precisely wished to say thanks once again. I do not know what I could possibly have worked on without the smart ideas contributed by you directly on my industry. It truly was a very challenging situation in my position, however , seeing a new expert approach you handled the issue forced me to jump for fulfillment. I am happier for this guidance and as well , pray you find out what an amazing job you are accomplishing teaching people today through the use of your site. I’m certain you’ve never encountered all of us.

    回复 2019年10月16日
  25. jordan 11

    I am commenting to make you understand of the great discovery my cousin’s daughter found visiting your web page. She figured out a lot of pieces, which include what it’s like to possess a wonderful teaching character to let folks really easily grasp various tortuous subject areas. You undoubtedly exceeded people’s desires. Thank you for giving these useful, trustworthy, informative as well as easy guidance on the topic to Mary.

    回复 2019年10月16日
  26. jordan 4

    Thanks for each of your hard work on this site. My aunt take interest in conducting internet research and it’s obvious why. All of us notice all relating to the lively method you present sensible things via the website and as well welcome contribution from visitors about this topic while our girl is undoubtedly discovering a lot. Have fun with the remaining portion of the new year. You have been doing a terrific job.

    回复 2019年10月15日
  27. timberland outlet

    Thank you so much for giving everyone such a memorable chance to read from here. It’s usually so fantastic and also jam-packed with fun for me personally and my office co-workers to search your site really 3 times in a week to read the new guides you have. Of course, I am certainly motivated with all the beautiful tactics served by you. Certain 2 areas in this posting are rather the finest we have ever had.

    回复 2019年10月14日
  28. curry 4

    I and also my buddies were following the excellent recommendations from your web page while quickly I got a terrible suspicion I had not expressed respect to the site owner for those secrets. All the women appeared to be certainly happy to see all of them and have in effect absolutely been making the most of them. We appreciate you simply being considerably thoughtful and for choosing this sort of superior subject matter most people are really wanting to be aware of. My sincere apologies for not expressing appreciation to you sooner.

    回复 2019年10月13日
  29. golden goose

    I wish to show some thanks to this writer just for bailing me out of this trouble. Just after looking through the the net and meeting thoughts which were not helpful, I figured my life was over. Existing without the approaches to the difficulties you have resolved as a result of the review is a crucial case, as well as the ones that might have badly affected my career if I hadn’t discovered your blog. Your main capability and kindness in playing with all the things was very useful. I am not sure what I would have done if I had not discovered such a step like this. I can at this moment look forward to my future. Thanks for your time very much for the specialized and sensible help. I won’t think twice to refer the sites to any person who requires tips on this situation.

    回复 2019年10月12日
  30. nike vapormax

    My spouse and i have been now cheerful that Louis managed to finish up his survey through the entire ideas he got through the web site. It is now and again perplexing just to always be freely giving strategies that people have been making money from. And now we keep in mind we have got you to thank for this. The main illustrations you’ve made, the straightforward site navigation, the relationships your site help to instill – it is everything sensational, and it’s really making our son in addition to our family recognize that this issue is pleasurable, and that is rather pressing. Thank you for the whole lot!

    回复 2019年10月11日
  31. jordan shoes

    My wife and i felt really contented when John managed to finish off his inquiry through the precious recommendations he came across while using the site. It’s not at all simplistic just to happen to be making a gift of points which usually many people have been trying to sell. And we grasp we need the blog owner to be grateful to for this. Those explanations you have made, the straightforward web site navigation, the friendships you will give support to engender – it’s everything unbelievable, and it’s really letting our son in addition to the family consider that the idea is brilliant, which is rather essential. Thanks for the whole thing!

    回复 2019年10月10日
  32. yeezy 500

    I’m just writing to let you be aware of what a remarkable experience my cousin’s princess enjoyed viewing your webblog. She discovered some details, most notably what it’s like to have an excellent helping nature to let many people clearly understand selected specialized subject areas. You really did more than visitors’ expectations. Thanks for coming up with the informative, dependable, informative and as well as unique guidance on that topic to Jane.

    回复 2019年10月9日
  33. fila

    I have to convey my admiration for your kind-heartedness in support of individuals who require guidance on this topic. Your very own commitment to getting the message around had been exceedingly effective and has encouraged associates much like me to realize their pursuits. This informative information implies a lot a person like me and further more to my office colleagues. Regards; from all of us.

    回复 2019年10月8日
  34. curry 6

    I in addition to my guys appeared to be analyzing the great things found on your web site then then I had an awful feeling I had not thanked the web site owner for those techniques. These people had been certainly joyful to study them and have absolutely been making the most of them. Appreciation for genuinely indeed considerate and then for having variety of excellent ideas millions of individuals are really needing to discover. My personal honest apologies for not saying thanks to you earlier.

    回复 2019年10月8日