position

转盘抽奖的实现

夙愿已清 提交于 2019-12-03 08:09:42
如图效果展示:(因最近双十一,公司需求要给新老客服抽奖发福利,临时写的) 核心代码: async rotating() { var type = 0; // 默认为 0 转盘转动 1 箭头和转盘都转动(暂且遗留) var during_time = 5; // 默认为1s var result_index = this.index-1; // 最终要旋转到哪一块,对应prize_list的下标 var result_angle = [190 ,139 ,88 ,37 ,-14,-65 ,-116] //这里是指定位置 var rand_circle = 6; // 附加多转几圈,2-3 var rotate_angle = 0; this.count++ if (type == 0) { // 转动盘子 var rateround=rand_circle * 360 + result_angle[result_index] //这里是(转盘算法) rateround是转动的距离 this.start_rtating是每次初始化转盘的位置 rotate_angle =this.start_rotating_degree + rateround -this.start_rotating_degree % 360 ; this.start_rotating_degree = rotate

Angular Material MatTableDataSource cannot be found

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create a table using Angular Material Table , in the examples there is always the import: import {MatTableDataSource} from '@angular/material'; I'm trying to do the same but I'm getting an error: "Module ' ../node_modules/@angular/material/material ' has no exported member MatTableDataSource . Is there anything I'm missing? Here's the package.json versions: "dependencies": { "@angular/animations": "^4.4.6", "@angular/cdk": "^2.0.0-beta.12", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "

high-charts datalabel position needs to change when value is too small

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Data labels (in this case cash) appear in the right place, just inside the bar on the right, most of the time. However if the value of the bar is low enough, it ends up overlapping with the axis label (as shown by the purple bar). My first instinct was to set a max value and change the position of the data-label base on that. Something like, if value is less than $10 place the label outside just to the right of the bar. But there is a big problem with that approach. The size of the chart is variable and responsive, so that

Android: Animation Position Resets After Complete

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using an xml defined animation to slide a view off the screen. The problem is, as soon as the animation completes it resets to its original position. I need to know how to fix this. Here's the xml: Here's the Java that I use to call it: homeScrn = ( View ) findViewById ( R . id . homescreen ); slideLeftOut = AnimationUtils . loadAnimation ( this , R . anim . slide_left_out ); //Set Click Listeners For Menu btnHelp . setOnClickListener ( new OnClickListener () { public void onClick ( View v ) { LayoutInflater . from (

Overflow-x:hidden doesn't prevent content from overflowing in mobile browsers

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a website here . Viewed in a desktop browser, the black menu bar properly extends only to edge of the window, since the body has overflow-x:hidden . In any mobile browser, whether Android or iOS, the black menu bar displays its full width, which brings whitespace on the right of the page. As far as I can tell, this whitespace isn't even a part of the html or body tags. Even if I set the viewport to a specific width in the : The site expands to the 1100px but still has the whitespace beyond the 1100. What am I missing? How do I keep

PHP Page load/refresh to exact position

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What I'm trying to do is to pass a user to a php script via a href link, then have them passed back to exactly the same position that they were at before they clicked the link, like the page hasn't been refreshed. Does anyone know if or how this could be possible possible? Thank you. 回答1: Using HTML you can have the following <p id='open_here'><a href='script.php'> Send to script </a> </p> And then you can link back to that exact position with <a href="mypage.html#open_here">Send Back to page</a> So essentially, instead of using a regular

Delphi How to get cursor position on a control?

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to know the position of the cursor on a TCustomControl. 回答1: You can use MouseMove event: procedure TCustomControl . MouseMove ( Sender : TObject ; Shift : TShiftState ; X , Y : Integer ); begin Label1 . Caption := IntToStr ( x ) + ' ' + IntToStr ( y ); end ; 回答2: GetCursorPos can be helpful if you can't handle a mouse event: function GetCursorPosForControl ( AControl : TWinControl ): TPoint ; var P : TPoint ; begin Windows . GetCursorPos ( P ); Windows . ScreenToClient ( AControl . Handle , P ); result := P ; end ; 回答3: If

position:fixed inside of an iframe

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: For some reason, if I load an html page that has position:fixed on something, but I load it in an iframe, the fixed positions to not seem to render as fixed, but look more like absolute positioning. I'm not expecting the fixed divs to be fixed relative to the parent document. I would just think that they would be fixed in the iframe. Is this not possible in an iframe? 回答1: Chrome has a bug that doesn't fix elements with position:fixed if: a) you use CSS3 transform in any element, and/or b) you have a child element positioned outside the box

Break element out of container

一曲冷凌霜 提交于 2019-12-03 07:34:28
问题 I have all my content wrapped in a container element with a fixed width. But I have a <div> that I want to "break out" of that container to span the full width of the page. http://dabblet.com/gist/3207168 As you can see in that example, I've got the <div> to break out, but since it's positioned absolutely, it doesn't affect the flow of the page...which is what I'd like it to do. I want it to act like it's in the flow of the page, but expand the full width of the window. 回答1: Maybe http:/

jquery animate position in percentage

徘徊边缘 提交于 2019-12-03 07:08:27
how do I determine the positions in percentages? $(document).ready(function(){ $("#button").toggle(function(){ $("#slide").animate({top:-100%},1000); },function(){ $("#slide").animate({top:0%},1000); }); }); Please suggest. $(document).ready(function(){ $("#button").toggle(function(){ $("#slide").animate({top:'-100%'},1000); },function(){ $("#slide").animate({top:'0%'},1000); }); }); Add quotes. (I used single quotes, but js doesn't care if it is ' or ") 来源: https://stackoverflow.com/questions/11015399/jquery-animate-position-in-percentage