w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Shrink UIImage in bordered UIImageView
I would add the image view into a container view and draw the border on the container view. If you're doing the container in XIB then you can set the size there. If you're doing it in code, set the image view frame as: imageView.frame = CGRectInset(containerView.bounds, 10, 10);

Categories : IOS

how to put horizontal scroll with grow shrink animation on icons in android?
Your requirement is some what 3D Carousel type style. Check out Android 3D Carousel This may help you to get a start up. Making some changes in this project may help you achieve your goal.

Categories : Android

Sticky div on scroll
Check this: Demo here I added a new variable var dist = $('right_ads').getPosition().y; to store the original position and use it later and changed your else to a new if : if (window_top < dist) { Code: function sticky_AD() { var headerHeight2 = $('HEADER').getSize().y; var window_top = $(window).getScroll().y + headerHeight2 + 20; var div_top = $('right_ads').getPosition().y; if (window_top > div_top) { $('right_ads').addClass('fixed_AD').setStyles({ 'top': headerHeight2 + 20 }); } if (window_top < dist) { $('right_ads').removeClass('fixed_AD').setStyles({ 'top': 'auto' }); } } $(window).addEvent('scroll', function () { sticky_AD(); }); var dist = $('right_ads').getPosition().y; sticky_AD()

Categories : Javascript

Javascript sticky div after scroll
CSS #left { float:left; width:100px; height:200px; background:yellow; margin:200px 0 0; } #left.stick { position:fixed; top:0; margin:60px 0 0 } added a stick class, so javascript doesn't have to do too much work. JS // set everything outside the onscroll event (less work per scroll) var left = document.getElementById("left"), // -60 so it won't be jumpy stop = left.offsetTop - 60, docBody = document.documentElement || document.body.parentNode || document.body, hasOffset = window.pageYOffset !== undefined, scrollTop; window.onscroll = function (e) { // cross-browser compatible scrollTop. scrollTop = hasOffset ? window.pageYOffset : docBody.scrollTop; // if user scrolls to 60px from the top of the left div if (scrollTop >

Categories : Javascript

Please refine: Follow scroll but sticky on top
Here is the result. >> A jsfiddle of the code below I take CME64's word for it that the code is ok. Script $(document).ready(function(){ var el = $('#scrolldiv'); var originalelpos = el.offset().top; var scrolltimer; //run on scroll $(window).scroll(function () { var windowpos = $(window).scrollTop(); var currentpos = el.offset().top; if (windowpos >= currentpos) { el.addClass('scrollfixed'); } else if(currentpos >= $(window).scrollTop() + $(window).height() - el.height() ){ el.addClass('scrollfixedBtm'); }else{ var finaldestination = windowpos + originalelpos; el.stop().animate({ 'top': finaldestination }, 500); } clearTimeout(s

Categories : Jquery

Make blocks sticky on scroll
$(window).scroll(function() { var scrollPosition = $(window).scrollTop(); if (scrollPosition !== 0) { $("#CAPTION1").addClass("fixed"); } else { $("#CAPTION1").removeClass("fixed"); }); .fixed class has fixed position and located where you need Same thing for other Captions

Categories : Javascript

sticky footer working but with scroll
Provide absolute height to footer, make the position absolute or fixed and keep the footer block in outermost section as in body tag should be the parent of your footer div. You can check the example of same here http://www.blue-softwares.com/

Categories : CSS

Header overlaps the sticky box when scroll
When scrolling, an in-line style of top: 0px; gets applied to the element class .detailsBox this is why it appears to 'stick' to the header, kind of hard to play around with it when it's not in a fiddle, but from a brief overlook, you're altering the css top value alot here: if(scrollTop < "auto" + 10){ $StickyBox.css({ top: (200 - scrollTop) + "px", bottom: "auto" }); } else if (visibleFoot > gap) { $StickyBox.css({ top: "auto", bottom: visibleFoot + "px" }); } else { $StickyBox.css({ top: 0, bottom: "auto" }); } This shouldn't be necessary? You already have a margin-top of 28px on that element, and it's position is fixed, so it'll always be in the correct position.

Categories : Javascript

Nav fixed in bottom and after scroll geting sticky
this would be my approach: css #social-flat { position:fixed; bottom:0; width:100%; } #social-flat.top { bottom:inherit; top:0; } JS: jQuery.fn.extend({ moveFooterNav: function(){ var that = $(this); var fixNav = $("#social-flat"); var navPos = fixNav.offset; that.on({ scroll:function(){ var winPos = window.pageYOffset; if(winPos > navPos.top){ fixNav.addClass("top"); } else { fixNav.removeClass("top"); } } }); } }); $(window).moveFooterNav(); sorry, company blocks jsFiddle so I can't link to it.

Categories : Jquery

jQuery Sticky Header on Scroll un till the end of the Container
@Harsha M V Find the DEMO for your Question at http://jsfiddle.net/dKDJz/4/ var $sidebar = $("#sidebar"), $window = $(window), offset = $sidebar.offset(), sbBottom = Math.abs($window.height() - (offset.top + $sidebar.height())), prevScrollTop = 0; $window.scroll(function() { if (prevScrollTop < $window.scrollTop()) { $sidebar.removeClass('fixedTop'); if ($window.scrollTop() > (sbBottom + 12)) { $sidebar.addClass('fixedBtm'); } else { $sidebar.removeClass('fixedBtm'); } } else { $sidebar.removeClass('fixedBtm'); if ($window.scrollTop() > sbBottom) { $sidebar.addClass('fixedTop'); } else { $sidebar.removeClass('fixedTop'); } } prevScrollTop = $window.scrollTop(); });

Categories : Jquery

How to zoom in a uiimageview as I scroll down the table?
I suggesting changing the transform property of the image you are trying to scale - (void)scrollViewDidScroll:(UIScrollView*)scrollView{ // this is just a demo method on how to compute the scale factor based on the current contentOffset float scale = 1.0f + fabsf(scrollView.contentOffset.y) / scrollView.frame.size.height; //Cap the scaling between zero and 1 scale = MAX(0.0f, scale); // Set the scale to the imageView imageView.transform = CGAffineTransformMakeScale(scale, scale); } If you also need the scrollview to go to the top one the imageview has been zoomed out, then you will need to adjust the frame of the scrollview and imageview. Maybe you can tell us more about your desired effect.

Categories : Iphone

Sticky menu on click gets closed but opens after window scroll without clicking again
if (scrollVal > midheight) { $(dropdown).css({ 'position': 'fixed', 'top': '0', 'left': '0'/*, 'display': 'block'*/, 'z-index': '400', 'text-align': 'center', 'width': '100%', 'height': '100px' }); } else { $(dropdown).css({ 'position': 'absolute', 'top': '50px', 'left': '-100px' }); } Does it still do it if you make the change above? I commented out display: block, which was being set as long as the position was fixed. That's going to make it show again.

Categories : Javascript

Change UIImageView center point on scroll of UIScrollView
Figured it out, I actually needed to grab the instance of the ImageView within the ScrollView using. Anyone else trying to figure this out, I did it a little hacky but it works. /* Paralax Scrolling */ -(void)scrollViewDidScroll:(UIScrollView *)body { float y = body.contentOffset.y; // When adding (body) image view to scroll view I assigned a tag of 100 to it. [body viewWithTag:100].center = CGPointMake([body viewWithTag:100].bounds.size.width/2, ([body viewWithTag:100].bounds.size.height/2) + y/2); }

Categories : IOS

Twitter BootStrap, Sticky footer and 100% height dive give the page extra unnecessary scroll
from your description i think you want a sticky footer and a height 100% screen... Check the documnetation and examples on Twitter Bootstrap:- http://twitter.github.io/bootstrap/getting-started.html#examples Their is an example for a sticky footer:- http://twitter.github.io/bootstrap/examples/sticky-footer.html For this you have to download the documentations of Twitter Bootstrap:- http://twitter.github.io/bootstrap/index.html Hope this works for you... Thanks...

Categories : HTML

Multiple Sticky Elements Jquery Sticky Float
$(function() { $( ".post" ).each(function() { $(this).find('header').stickyfloat( { duration: 400 } ); }); }); Try like this. If this didn't work. Please a post fiddle with your code. So we can see what actually you have done there.

Categories : Jquery

CSS - sticky footer + sticky "message form"
Will this work for you: http://jsfiddle.net/NickWilde/ZRFwD/2/ code: html: <body> <div class="wrapper"> <p>Your website content here.</p> <div class="push"></div> </div> <div class="messages"> <ol> <li>Message One</li> <li>Message Two</li> <li>Message Three</li> </ol> <div class="messages-push"></div> <form action="#"> <fieldset> <input type="text"></input> <button type="submit">Send</button> </fieldset> </form><br /> </div> <div cla

Categories : CSS

How to display picked image in a uiimageview taken from the photo library to another uiimageview in a different view controller?
Create a UIImage property on your second ViewController and pass the image via prepareForSegue (Don't forget to import your second ViewController so ViewController knows about it) -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([[segue identifier] isEqualToString:@"yourSegueIdentifier"]) { yourSecondViewController *secondVC = [segue destinationViewController]; secondVC.nextImage = self.chosenImage; } } then in your second ViewController you can set the imageView yourSecondImageView.image = nextImage;

Categories : Iphone

How to assign UIImageView delegate to its super UIView so that it can know which UIImageView is touched
You Can Implement in this way Create and Image then enable userInteraction by [imageView setUserInteractionEnabled:YES] Then add tag and Give UITapGestureRecognizer with a selector that's all you need to doo. for(int i=0;i<4;i++){ MyImageView *imageView=[[MyImageView alloc] init]; [imageView setUserInteractionEnabled:YES]; [self.view addSubview:imageView]; [self.imageView setUserInteractionEnabled:YES]; [self.imageView setImage:[UIImage imageNamed:@"delete.png"]]; [self.imageView setTag:i]; UITapGestureRecognizer *tapped = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgTouchUp:)]; tapped.numberOfTapsRequired = 1; [self.imageView addGestureRecognizer:tapped]; } Then In selector recognize UIImaged taped by their respective T

Categories : Objective C

How to layer a partially tranparent UIImageView on top of an UIImageView?
you have to specify opaque with NO in UIGraphicsBeginImageContextWithOptions(CGSizeMake(width, height), NO, 0.0); else there will no alpha channel in the resulting image => it will have black pixels instead of transparent. Also: you dont need to clear the context before drawing, as it is already cleared. you dont need to push and pop the context, as you do not nest different contexts.

Categories : IOS

Change scale UIImageView after rotation UIImageView
See my answer here. Applying a "Make.." transform will wipe out any previously-applied transforms. You need to use the cumulative form, CGAffineTransformRotate

Categories : Iphone

UIImageView disappears after adding another UIImageView
if you want to remove any subview from view just add [self.view removeSubview:obj_name]; or if you wanna change image for image view change directly, firstImageView.image = //set image;

Categories : IOS

Animate a UIImageView from center of the UIImageView
What i suggest may be kind of hack but it will be an easier way to achieve what you want: You set the initial frame of imageView as: CGRectMake(center, center, 0, 0); So in your case it will be something closer to : CGRectMake(46, 37, 0, 0); Then animate it with new rect of something like this: CGRectMake(0, 0,93,75); You can use simple UIViewAnimation for this; [UIView beginAnimations:@"zoom" context:NULL]; [UIView setAnimationDuration:0.3]; imageView.frame = CGRectMake(0, 0, 93, 75); ; [UIView commitAnimations]; Hope It works

Categories : Iphone

AJAX chat scroll If has more than 20-30 messages, scroll to bottom will work if user didnt scroll up
Like this: http://jsfiddle.net/eP24K/2/ (see html/css to go along with below code) function insertLine() { var scrollPosition = $("#chat").scrollTop(); var scrollHeight = $("#chat")[0].scrollHeight; //console.log(scrollPosition,scrollHeight); $("#chat").append("<div>James: Hello World!</div>"); if (scrollPosition+$("#chat").height() === scrollHeight) { $("#chat").scrollTop(scrollHeight); } setTimeout(function(){ insertLine(); }, (Math.floor(Math.random()*1000))) } insertLine(); The code is in no way optimized, it's just concept.

Categories : Javascript

How to make a scroll area hide x & y both scroll bar, but only enable horizontal scroll?
Try adding an extra div between outer & inner called middle & use this CSS: http://jsbin.com/acexuq/3/ #outer { overflow:hidden; width: 400px; height: 400px; } #inner { overflow:auto; width:4000px; height:400px; } #middle { overflow: scroll; width:417px; height:417px; }

Categories : Jquery

Moving the UIImageView Place in UIScrollview to Another UIImageView Placed on Next UIScrollview
You can use a PanGestureRecognizer for this. You need to move the view to the superview of the scrollView while dragging and then after releasing it, you need to place it in the new scrollView correctly. I wrote a library for exactly this, check out my JDDroppableView Library: https://github.com/jaydee3/JDDroppableView

Categories : Iphone

Difference between [[UIImageView new] init] and [[UIImageView alloc] init]
+ new is equivalent with + alloc followed by - init, so UIImageView *iv = [[UIImageView alloc] init]; and UIImageView *iv = [UIImageView new]; are right (and equivalent) and UIImageView *iv = [[UIImageView new] init]; is wrong, since it calls - init twice.

Categories : Iphone

Shrink UITableViewCell
Do you mean collapse the sections, so that only the section header shows up until a used taps it? Implement tableView:numberOfRowsInSection: to return 0 if the section is not open and the actual number of rows if open. Update: I had to run before I could take a good look at the source and flesh out my answer: MainController.m of the sample code is where that method is implemented (the .xib sets MainController as the delegate of the table view). If you want one section open at a time, have one variable in MainCotroller that stores the open section. In tableView:numberOfRowsInSection: do something like this: if (section == [self openSection]) { return [[cellCount objectAtIndex:section] intValue]; } return 0; Obviously you haveto set openSection when a user taps it. If you want m

Categories : IOS

CSS Div That Can Shrink When Another Div Animates
Not sure if I fully understand what you want but I'll take shot. consider putting the heading and the paragraph text in the same <div>, like so: <div class='container'> <div id="popup">Here is a new section that appears</div> <div> <h1>This Is Heading Text In Collapsable Div</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam mattis in magna eu faucibus. Vestibulum vel fringilla diam. Nulla eget posuere massa. Pellentesque fringilla sapien in rutrum gravida. Phasellus sapien ligula, sagittis sed tellus vitae, semper feugiat nulla. In fermentum, elit eget ornare mattis, mi elit pretium arcu, eget cursus augue velit ac leo. In hendrerit justo eu metus adipiscing, sit amet venenatis sem elementum. Vi

Categories : Jquery

How to shrink boost::offset_ptr
offset_ptr with default template parameters is static const std::size_t offset_type_alignment = 0; template <class T, class DifferenceType = std::ptrdiff_t, class OffsetType = std::size_t, std::size_t Alignment = offset_type_alignment> class offset_ptr; You can change third parameter of offset_ptr. #include <iostream> #include <boost/interprocess/offset_ptr.hpp> #include <cstdint> int main() { using namespace boost::interprocess; offset_ptr<int, std::ptrdiff_t, std::uint32_t> offs; std::cout << sizeof(offs) << std::endl; }

Categories : C++

IE7 Elements shrink on hover
Are you using boxsizing.htc? Remove it (yep layout is broken but that's a test). Is the bug gone? I don't have the solution except when removing the HTC from ONE element is sufficient but layout isn't affected. To remove it, just redeclare behavior property with url() value: .ie67 .noboxsizing { behavior: url(); }

Categories : CSS

Form shrink during start up
The position is set like this: MainForm.Position:= poDefault And that is the answer. http://docwiki.embarcadero.com/Libraries/XE4/en/Vcl.Forms.TForm.Position The form appears in a position on the screen and with a height and width determined by the operating system. However there are other options like poDefaultPosOnly: The form displays with the size you created it at design time, but the operating system chooses its position on the screen poScreenCenter: The form remains the size you left it at design time, but is positioned in the center of the screen. And many others. Additionally, you may avoid fixing the issue and add a workaround instead: just set the form size fixed using http://docwiki.embarcadero.com/Libraries/XE4/en/Vcl.Forms.TForm.Constraints

Categories : Windows

How can I shrink a div when it has inline styling?
css3 #class:target{ -webkit-transform: scale(0.25); -moz-transform: scale(0.25); -o-transform: scale(0.25); -ms-transform:scale(0.25); transform:scale(0.25); } http://jsfiddle.net/s26cm/

Categories : HTML

UIPopoverBackgroundView border shrink
Does it only happen in the simulator or also on a real device? This specifically seems to only happen when the popover contains a scrollview/tableview which is larger than the popover (i.e. it is scrollable) Do you resize the scrollview / tableview in this case? Try adding a UIView inside your UIPopView that would be the container.

Categories : IOS

std::vector shrink to fit?
shrink_to_fit is a new C++11 feature that won't be in every compiler yet. The old way of doing this was to swap with a temporary: std::vector<double>(myvector).swap(myvector);

Categories : C++

float:right causes parent div to shrink
Try adding overflow: hidden; to .outerdiv - as this creates a new Block Formatting Context for it's descendants (which are taken out of the normal flow, because they're floated, similar to the way absolutely positioned elements are, but not identical) - it basically allows the container to acknowledge the presence of the float as if it were in the normal flow. The key is to remember that regular block-level elements in the normal flow will ignore a float if it isn't cleared or if a new block formatting context isn't provided.

Categories : HTML

Shrink a div to it's horisontal center
See this demo fiddle The CSS is: div { width: 200px; position: absolute; } .mid { background: url("http://placekitten.com/200/300"); height: 200px; top: 100px; -webkit-transition: all 2s; transition: all 2s; } .top { top: -100px; height: 100px; background-color: gray; } .bottom { bottom: -100px; height: 100px; background-color: gray; } .mid:hover { height: 0px; margin-top: 100px; background-position: 0px -50px; } The trick is to modify the height, and at the same time change the margin-top so that the center stays at the same place. And at the same time change the background position, also accordingly. I have done this effect because this is what I saw in the video, even though your question seems to ask for the bac

Categories : CSS

How to make layouts grow and shrink?
You need to create xml files for different screen sizes http://developer.android.com/guide/practices/screens_support.html design your XML files to use references instead of hardcoded strings. You can then assign a reference to layouts, buttons and so on which has a different value depending on screen sizes. (use android:padding="@dimen/pagepadding" instead of android:padding="16dp" and define the dp in values/dimens.xml like this: <dimen name="pagepadding">16dp</dimen>) To do that you have to create new folders in your Project like values-sw600dp for devices with 600dp smallest width (like Nexus 7 I believe) or values-sw720dp-land for devices with the smallest width of 720dp (10 inch tablets I believe) in landscape. Do some reading on the developer page and on the internet

Categories : Android

iframe expand and shrink on hover
I'm not sure if you got the point of <iframe> - iframe is meant to display content from another url within a "box" in your page, it must have a src attribue that links to the other page. (as @MrLister said - the content within it's markup is only shown when the browser does not support iframes) You should try using <div> instead like this: <div id="parent".....><ul><li class="drop_item">button1</li><li class="drop_item">button2</div></ul></div> And then apply this CSS code (no need of jQuery in this case): #parent{ width:300px; height:50px; } #parent:hover{ width:100%; hieght:100%; } **note that these CSS rules should also work if you decide to keep working with the iframe

Categories : Jquery

How to shrink a string and be able to find the original later
First I would suggest re-looking at why you can't just mail the entire log content? Unless you have large logs (>5MB) I'd suggest just mailing the log. If you still want to pursue some shrinking strategy there are two I'd consider. If you want a simple reference string which can be used to lookup your log data at some later stage you can just associate some sort of identifier with the data (e.g. a GUID as suggested by Eugene). This has the benefit of having a constant length, irrespective of the log size. Alternatively you could just compress the log, this will shrink the data somewhat (anything up to about 90%, as Dan mentioned). However this has the downside of having a variable length and for very large logs may still exceed your size limitations. If you go this route you could do som

Categories : C#

How to auto-shrink text with CSS/HTML
I'm not sure if you can dynamically change the size of your floated elements with CSS based on the content, but part of the problem can be solved with: Adding to #leftDesc: text-overflow:ellipsis; white-space:nowrap; The white-space property keeps the text on one line; text-overflow should be pretty self-explanatory. JSFiddle

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.