height

Change the size of dragged clone when hovering droppable?

自闭症网瘾萝莉.ら 提交于 2019-12-14 02:41:18
问题 $(".drag").draggable({ helper: 'clone', appendTo: "body" }); $( ".drop" ).droppable({ over: function(event, ui) { $(ui.draggable).css({width:'30px',height:'30px'}); }, drop: function( event, ui ) { if($(ui.draggable).parent() !==$(this)){ $(ui.draggable).appendTo($( this )); $(ui.draggable).tooltip({ disabled: true }); $(ui.draggable).css({float:'left'}); } }}); I am trying to change the size of the dragged clone item when i hover over the droppable area but leave the original the same size

How to calculate each element's height and use these values as a variable in function?

拥有回忆 提交于 2019-12-13 21:04:15
问题 I am trying to create a simple text accordion which calculates each panel's height and return this value as a variable. I can get values with if statements like if ( i === 0 ) { $(this).height(); } but can't get this variable to the outside.I can do this without using variable but it became useless in long term. Brıefly: I want to calculate each element's height and use this variable inside click function. Here is jsFiddle which includes the problem. var panel = $('.holder div'); var trigger

How to detect that an Html element is in View?

对着背影说爱祢 提交于 2019-12-13 20:03:08
问题 Using Jquery preferably, how do I detect if an element is within the viewable client area of a browser? I'm dynamically creating a menu from a dataset, and when the list grows too long, the height of the resulting menu causes part of it to fall below the browser bottom client area. How do I detect this and act accordingly? 回答1: I believe it should be possible to cook something up using position() and scrollTop() (add scrollLeft if your page is prone to horizontal scrolling). Here is some

CSS width/height of IMG and TD

回眸只為那壹抹淺笑 提交于 2019-12-13 19:06:30
问题 I have a problem in css, I have a TD with a width:100px; and height:100px; inside it, I have an img element with the same width and height (100px, 100px). The problem is that the TD is automatically resized to 145px width and 114 px height. If anyone know why, and how to solve it please help me! (it would be great if I did not need no increase my TD's size, my image must be 100*100) This problem has been fixed, I had commented that part of the css. But my image is now placed under my text in

Adjusting height of UITextView to its text does not work properly

早过忘川 提交于 2019-12-13 18:24:25
问题 I wrote following code to fit UITextView's height to its text. The size changes but top margin relative to first line of text differ every other time when I tap enter key on keyboard to add new line. Setting xCode 7.3 Deployment target: iOS 9 import UIKit class ViewController: UIViewController, UITextViewDelegate { lazy var textView: UITextView = { let tv = UITextView(frame: CGRectMake(20, 200, (self.view.frame.width - 40), 0) ) tv.backgroundColor = UIColor.lightGrayColor() return tv }()

React Native: Height vs flex

北城余情 提交于 2019-12-13 18:00:59
问题 While setting height of multiple components in a view, is there any difference between setting the height in terms of flex or height? For eg, 1) <View> <View style={{flex:1}}> </View> <View style={{flex:3}}> </View> </View 2) var windowSize = Dimensions.get('window'); <View> <View style={{height:windowSize.height/4}}> </View> <View style={{height:windowSize.height*3/4}}> </View> </View> 回答1: Yes, when you rotate a device flex is responsive where as window isn't. For example if the device

squared boxes by height (not width) to create equal width (aspect ratio)

随声附和 提交于 2019-12-13 17:26:38
问题 I know the squared solution with :before { padding-bottom } . This works only with a width value, because padding is always using a relation to the parents width. - But exactly this is my problem. I ONLY have the value of the a fixed HEIGHT (by parent container) and I need squared boxes by that height value. I don't like to use JS. If there is a solution to REPLACE the STATIC WIDTH value with pure CSS, please tell me! Here's a simple code sample: div.wrapper { height: 70px; padding: 5px;

Textarea 100% height in IE

青春壹個敷衍的年華 提交于 2019-12-13 17:16:32
问题 How do I get my <textarea> to have a height of 100% and work in IE7/6? height:100% works fine in all other browsers but IE just doesn't want to accept anything other than specific values. Javascript is a possible solution. 回答1: In order for an element to achieve 100% height in IE6, you will need to specify a fixed height of its parent element. If you want to make the element the full-length of your page, apply height:100%; to both the html and body elements. /*100% height of the parent

Frame loosing height when filled tkinter

谁都会走 提交于 2019-12-13 08:01:46
问题 Hello everyone i am learning to make a gui with tkinter but i run into something and can't find the answer to it i have 3 frames a header a shadow for the header and a main content frame and that works fine code : root = Tk() root.geometry("1080x600") root.minsize(width=1080, height=600) root.maxsize(width=1080, height=600) root.title("learning ui") headerFrame = Frame(root, height=50, bg="#17181b") headerShadow = Frame(root, height=3, bg="#08090a") contentFrame = Frame(root, bg="#17181b")

Change target of a link based on what is currently displayed

江枫思渺然 提交于 2019-12-13 07:37:29
问题 Again, I'm quite new to jQuery and there are still many things that seem simple yet get me stuck for hours. Right now, I'm trying to replace the target of a link. That I know how to do. But the thing is, the target has to change based on the div currently displayed. Here's the wireframe : The link, of course, is on the arrow, which is fixed at the bottom of the viewport. You might have guessed by now, I'd like the link to point to #div2 when the visitor is on #div1, to #div3 when they are on