Search Results

Search found 4 results on 1 pages for 'supersize'.

Page 1/1 | 1 

  • Fullscreen image with jquery on window resize?

    - by lauthiamkok
    I am trying to make fullscreen images with jquery when the window resize function is triggered. But I get this kind of result - where you can see a gap at the bottom of the image which I don't know how to fix it. the basic html, <!-- container --> <div id="container" class="container"> <div class="holder-supersize" id="supersize"> <ul class="background-supersize"> <li><a href="#"><img src="styles/images/IMG_0250.jpg" alt="" width="1000" height="667" /></a></li> <li><a href="#"><img src="styles/images/IMG_0255.jpg" alt="" width="667" height="1000" /></a></li> <li class="active"><a href="#"><img src="styles/images/IMG_0323.jpg" alt="" width="1158" height="772" /></a></li> </ul> </div> </div> <!-- container --> jquery for updating image size on window resize, $(document).ready(function(){ $(window).resize(function(){ $(".holder-supersize").each(function() { //Define image ratio & minimum dimensions var minwidth = .5*(640); var minheight = .5*(480); var ratio = 480/640; //Gather browser and current image size var imagewidth = $(this).width(); var imageheight = $(this).height(); var browserwidth = $(window).width(); var browserheight = $(window).height(); //Check for minimum dimensions if ((browserheight < minheight) && (browserwidth < minwidth)){ $(this).height(minheight); $(this).width(minwidth); } else { //When browser is taller if (browserheight > browserwidth){ imageheight = browserheight; $(this).height(browserheight); imagewidth = browserheight/ratio; $(this).width(imagewidth); if (browserwidth > imagewidth){ imagewidth = browserwidth; $(this).width(browserwidth); imageheight = browserwidth * ratio; $(this).height(imageheight); } } //When browser is wider if (browserwidth >= browserheight){ imagewidth = browserwidth; $(this).width(browserwidth); imageheight = browserwidth * ratio; $(this).height(imageheight); if (browserheight > imageheight){ imageheight = browserheight; $(this).height(browserheight); imagewidth = browserheight/ratio; $(this).width(imagewidth); } } } return false; }); }); }); CSS for supersize image /* Supersize -------------------------------------------*/ .holder-supersize { width:100%; height:100%; position:absolute; left:0; top:0; z-index:0; } .background-supersize { width:100%; height:100%; overflow:hidden; position:relative; } .background-supersize li { width:100%; height:100%; overflow:hidden; position:absolute; left:0; top:0; text-align:center; } .background-supersize li img { /* for image with height < width */ /**/ width:100%; height:auto; /* for image with height > width */ /* width:auto; height:100%; */ } .background-supersize li , .background-supersize a, .background-supersize img{ display:none; } .background-supersize .active, .background-supersize .active a, .background-supersize .active img{ display:inline; } This is the link at jsfiddle and this is the link to see the actual product. Any ideas what I have done wrong and how can I fix it?

    Read the article

  • How do I perform a flip and grow animation like in iPhoto 09?

    - by Austin
    I'm developing a Cocoa application and want to be able to click a button in one of the views in my NSCollectionView and have a details view flip open and position to the middle of the screen like it does in iPhoto 09 when you click the "i" in the bottom-right hand corner of a photo. The photo "flips" and grows, centered on the window to reveal details about the photo. I'm guessing they're using Core Animation to achieve this. I've been looking at the Lemur Flip example, but when I try to modify it to add repositioning code to the animation, it throws off the flip. Here is the positioning code I've added to the - (IBAction)flip:(id)sender; code of LemurFlip: ... [CATransaction begin]; { NSSize supersize = contentView.frame.size; // Size of window content view NSSize subsize = frontView.frame.size; // Size of view we're flipping out if(!frontView.isHidden) { // Move views to middle of the window [[backView animator] setFrameOrigin:NSMakePoint((supersize.width / 2) - (subsize.width / 2), (supersize.height / 2) - (subsize.height / 2))]; [[frontView animator] setFrameOrigin:NSMakePoint((supersize.width / 2) - (subsize.width / 2), (supersize.height / 2) - (subsize.height / 2))]; } else { // Return views to point of origin [[backView animator] setFrameOrigin:NSMakePoint(0, 0)]; [[frontView animator] setFrameOrigin:NSMakePoint(0, 0)]; } [hiddenLayer addAnimation:[self _flipAnimationWithDuration:flipDuration isFront:NO] forKey:@"flipGroup"]; [visibleLayer addAnimation:[self _flipAnimationWithDuration:flipDuration isFront:YES] forKey:@"flipGroup"]; } [CATransaction commit]; ... Is there a good example of how to do this or some rules for combining these sort of animations?

    Read the article

  • class selector refuses after append to body

    - by supersize
    I'm appending loads of divs in a wrapper: var cubes = [], allCubes = '', for(var i = 0; i < 380; i++) { var randomleft = Math.floor(Math.random()*Math.floor(Math.random()*1000)), randomtop = Math.floor(Math.random()*Math.floor(Math.random()*1000)); allCubes += '<div id="cube'+i+'" class="cube" style="position: absolute; border: 2px #000 solid; left: '+randomleft+'px; top: '+randomtop+'px; width: 9px; height: 9px; z-index: -1"></div>'; } $('#wrapper').append(allCubes); // performance for(var i = 0; i < 380; i++) { cubes.push($('#cube'+i)); } and then I would like to make them all draggable with jQueryUI and log their current position. var allc = $('.cube'); allc.draggable().on('mouseup', function(i) { allc.each(function() { var nleft = $(this).offset().left; var ntop = $(this).offset().top; console.log('cubes['+i+'].animate({ left:'+nleft+',top:'+ntop+'})'); }); }); Unfortunenately it does not work. They are neither draggable nor there comes up a log. Thanks

    Read the article

  • How do I read and traverse inodes

    - by Eric Fossum
    I've opened the super-block and group descriptor in an EXT2 filesystem, but I don't know how to read for instance the root directory or files in it... Here's some of what i got fd=open("/dev/sdb2", O_RDONLY); lseek(fd, SuperSize, SEEK_SET); read(fd, &super_block, SuperSize); lseek(fd, 4096, SEEK_SET); read(fd, &groupDesc, DescriptSize); but this next part doesn't seem to work... lseek(fd, super_block.s_log_block_size*groupDesc.bg_inode_table, SEEK_SET); lseek(fd, InodeSize*(EXT2_ROOT_INO-1), SEEK_CUR); read(fd, &root, InodeSize);

    Read the article

1