Search Results

Search found 418 results on 17 pages for 'william edmondson'.

Page 3/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Ubuntu 13.10 Unity doesn't load after upgrade

    - by William
    Just upgraded to Ubuntu 13.10 only to find that Unity won't load (login freezes, after doing ctrl+alt+F1, logging in and then doing startx, I get a blank desktop and the mouse pointer, and nothing else). I can right click, but the only operations that work are "create new file" and "create new folder". For example, "change desktop background" doesn't work. Also, after doing a few right clicks and choosing "change desktop background", I get a warning message box: "compiz closed unexpectedly." Guest login works fine. Tried creating a new user, but I experience the same thing with the new user. Tried removing all configuration files from my home directory... same thing. Doing dconf reset -f /org/compiz/ gives an error "error spawning command line..." Doing unity --reset also gives errors. Tried uninstalling unity (and compiz) and reinstalling, but that doesn't help. Tried reconfiguring lightdm, didn't help. I don't have any proprietary drivers installed. Once again, the funny thing is that the guest session works fine.

    Read the article

  • Sound through HDMI with the NVIDIA drivers

    - by William
    I am running a media center setup with the display through HDMI, powered by a NVIDIA card. I am using the proprietary NVIDIA drivers availabler through the additional drivers utility, on Xubuntu 11.10. In the mixer, I have all the volumes unmuted and turned up to 100%, but no sound through the HDMI. If I plug in speakers the nd comes through just fine. What can I do to make the sound go through the HDMI and to the TV?

    Read the article

  • Does this factory method pattern example violate open-close?

    - by William
    In Head-First Design Patterns, they use a pizza shop example to demonstrate the factory method pattern. public abstract class PizzaStore { public Pizza orderPizza(String type) { Pizza pizza; pizza = createPizza(type); pizza.prepare(); pizza.bake(); pizza.cut(); pizza.box(); return pizza; } abstract Pizza createPizza(String type) } public class NYPizzaStore extends PizzaStore { Pizza createPizza(String item) { if (item.equals("cheese") { return new NYStyleCheesePizza(); } else if (item.equals("veggie")) { return new NYStyleVeggiePizza(); } else if (item.equals("clam")) { return new NYStyleClamPizza(); } else if (item.equals("pepperoni")) { return new NYStylePepperioniPizza(); } else return null; } } I don't understand how this pattern is not violating open-close. What if we require a beef Pizza, then we must edit the if statement in the NYPizzaStore class.

    Read the article

  • Wireless connection disconnects and reconnects with a Netgear WNA1000

    - by William Berkenkamp
    Ever since I made the permanent switch from Vista to Ubuntu i've had wireless connectivity problems. From watching the network manager when it disconnects it seems like it turns off the receiver for some reason. Could it be bad drivers? I used their install software and the site doesn't really offer driver downloads. The adapter is a Netgear WNA1000 if memory serves, and I don't know much about the router except that it's a Motorola Surfboard. And I figure this might help a bit *-network description: Ethernet interface product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller vendor: Realtek Semiconductor Co., Ltd. physical id: 0 bus info: pci@0000:01:00.0 logical name: eth0 version: 01 serial: 00:1b:b9:a7:39:a4 size: 10Mbit/s capacity: 100Mbit/s width: 64 bits clock: 33MHz capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=N/A latency=0 link=no multicast=yes port=MII speed=10Mbit/s resources: irq:40 ioport:d800(size=256) memory:feaff000-feafffff memory:feac0000-feadffff *-network description: Wireless interface physical id: 1 bus info: usb@2:1.1 logical name: wlan0 serial: 00:26:f2:8b:fb:38 capabilities: ethernet physical wireless configuration: broadcast=yes driver=carl9170 driverversion=3.2.0-24-generic-pae firmware=1.9.4 ip=10.0.0.36 link=yes multicast=yes wireless=IEEE 802.11bgn I have tried installing WICD and it didn't fix the problem. Any help would be greatly appreciated. This problem is greatly limiting what I can do with my computer.

    Read the article

  • How'd they do it: Millions of tiles in Terraria

    - by William 'MindWorX' Mariager
    I've been working up a game engine similar to Terraria, mostly as a challenge, and while I've figured out most of it, I can't really seem to wrap my head around how they handle the millions of interactable/harvestable tiles the game has at one time. Creating around 500.000 tiles, that is 1/20th of what's possible in Terraria, in my engine causes the frame-rate to drop from 60 to around 20, even tho I'm still only rendering the tiles in view. Mind you, I'm not doing anything with the tiles, only keeping them in memory. Update: Code added to show how I do things. This is part of a class, which handles the tiles and draws them. I'm guessing the culprit is the "foreach" part, which iterates everything, even empty indexes. ... public void Draw(SpriteBatch spriteBatch, GameTime gameTime) { foreach (Tile tile in this.Tiles) { if (tile != null) { if (tile.Position.X < -this.Offset.X + 32) continue; if (tile.Position.X > -this.Offset.X + 1024 - 48) continue; if (tile.Position.Y < -this.Offset.Y + 32) continue; if (tile.Position.Y > -this.Offset.Y + 768 - 48) continue; tile.Draw(spriteBatch, gameTime); } } } ... Also here is the Tile.Draw method, which could also do with an update, as each Tile uses four calls to the SpriteBatch.Draw method. This is part of my autotiling system, which means drawing each corner depending on neighboring tiles. texture_* are Rectangles, are set once at level creation, not each update. ... public virtual void Draw(SpriteBatch spriteBatch, GameTime gameTime) { if (this.type == TileType.TileSet) { spriteBatch.Draw(this.texture, this.realm.Offset + this.Position, texture_tl, this.BlendColor); spriteBatch.Draw(this.texture, this.realm.Offset + this.Position + new Vector2(8, 0), texture_tr, this.BlendColor); spriteBatch.Draw(this.texture, this.realm.Offset + this.Position + new Vector2(0, 8), texture_bl, this.BlendColor); spriteBatch.Draw(this.texture, this.realm.Offset + this.Position + new Vector2(8, 8), texture_br, this.BlendColor); } } ... Any critique or suggestions to my code is welcome. Update: Solution added. Here's the final Level.Draw method. The Level.TileAt method simply checks the inputted values, to avoid OutOfRange exceptions. ... public void Draw(SpriteBatch spriteBatch, GameTime gameTime) { Int32 startx = (Int32)Math.Floor((-this.Offset.X - 32) / 16); Int32 endx = (Int32)Math.Ceiling((-this.Offset.X + 1024 + 32) / 16); Int32 starty = (Int32)Math.Floor((-this.Offset.Y - 32) / 16); Int32 endy = (Int32)Math.Ceiling((-this.Offset.Y + 768 + 32) / 16); for (Int32 x = startx; x < endx; x += 1) { for (Int32 y = starty; y < endy; y += 1) { Tile tile = this.TileAt(x, y); if (tile != null) tile.Draw(spriteBatch, gameTime); } } } ...

    Read the article

  • Message "Getting information" don't close

    - by William
    I have Windows 7 x64 I installed this software and I have a problem. I like Ubuntu but I feel the softwares related Linux often have problems. We each time need to seek to resolve the malfunctions. my problem is , I am getting a message as Getting information, please wait and it don't disappear. My firewall is completely deactivate and I already go to the UAC or the firewall to allow the "exe" of the Ubuntu One software in the settings. Nothing runs.Linux never run at the first time. I'm really disappointed and discouraged. Please help me. Thank you for your answers... Ps : I have Windows 7 64 bits

    Read the article

  • Windows gets progressively slower over time, why doesn't Ubuntu?

    - by William
    I, and many other previous Windows users notice that the computer seems to get progressively slower over time. I bought a leapfrog crammer only to find it installed process that sat there waiting for me to plug the crammer in so it could run the software. It took up three percent of the CPU twenty-four seven, seven day a week! This is one of the main reasons I left Windows. But, Ubuntu doesn't seem to slow down over time at all. Does Ubuntu allow programs to install background programs like the leapfrog crammer did to sit there like a leech and suck away at resources? Could someone explain why Windows tends to get slower over time, and is Ubuntu vulnrable to this too? Thanks for any help, this is puzzling me.

    Read the article

  • Problem using python QPID and gevent together [closed]

    - by William Payne
    I have a python script that pulls messages from an Apache QPID queue, and then uses gevent to perform (IO-bound) tasks on those messages in parallel. The queue that this script pulls from was recently changed: I suspect the version of the C++ QPID broker changed, although I cannot verify this at the present time. Now, my process deadlocks and hangs upon QPID queue creation. I strongly suspect that this is a result of an incompatibility with gevent, although I have not done the work yet to produce a minimal example to demonstrate the problem. (Next on my list). Does anybody else have experience of getting gevent and QPID to work together? or Has anybody else seen the same issues?

    Read the article

  • Am I violating LSP if the condition can be checked?

    - by William
    This base class for some shapes I have in my game looks like this. Some of the shapes can be resized, some of them can not. private Shape shape; public virtual void SetSizeOfShape(int x, int y) { if (CanResize()){ shape.Width = x; shape.Height = y; } else { throw new Exception("You cannot resize this shape"); } } public virtual bool CanResize() { return true; } In a sub class of a shape that I don't ever want to resize I am overriding the CanResize() method so a piece of client code can check before calling the SetSizeOfShape() method. public override bool CanResize() { return false; } Here's how it might look in my client code: public void DoSomething(Shape s) { if(s.CanResize()){ s.SetSizeOfShape(50, 70); } } Is this violating LSP?

    Read the article

  • Long 'Wait' Time for three php/CSS files. Is something blocking them?

    - by William Pitcher
    I have been speed optimizing a Wordpress site to little effect. There are three files CSS-related php files from the Wordpress theme that are delaying page loads on the site. One of the three files is basically one line of custom CSS from the custom CSS feature in the theme. You can see what I am talking about with this Pingdom speed test: The yellow is 'Wait'. There are no slow items in the cut-off portion of the image. The full results are here: Pingdom Results Page 1. Any thoughts on what might be causing this? I understand that I have blocking CSS or JS files, but I don't see anything that would be causing that long of a wait. When I ran the P3 Plugin Profiler, Wordpress and all plugins appeared fine -- it is the theme that is taking all the time. GTmetrix recommends avoiding dynamic queries. I assume all the ver=3.61 references are to the version of Wordpress (which I am using). I noticed that my Wordpress sites using other themes don't make this query (at least not over and over). 2. Is this typical coding practice? 3. How much negative impact do these query-strings have -- a little or a lot? I tried searching for similar questions here, please excuse me if I missed something. Sometimes, I know just enough to be dangerous.

    Read the article

  • How do I install VirtualBox 4.1?

    - by William
    How to install virtualbox-4.1.4 in ubuntu 11.04 fluently? when apt-get install libqt* unmet dependency. there is a long list of unmet dependency. Where start first and any command to install virtualbox fluently? You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: virtualbox-4.1 : Depends: libcurl3 (>= 7.16.2-1) but it is not going to be installed Depends: libqt4-network (>= 4:4.5.3) but it is not going to be installed Depends: libqt4-opengl (>= 4:4.7.0~rc1) but it is not going to be installed Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not going to be installed Depends: libqtgui4 (>= 4:4.7.0~beta1) but it is not going to be installed Recommends: libsdl-ttf2.0-0 but it is not going to be installed Recommends: dkms but it is not going to be installed Recommends: libhal1 (>= 0.5) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

    Read the article

  • Leapfrog Crammer won't mount as a USB flash drive

    - by William
    I can't seem to get the Leapfrog Crammer study and sound system to show up as a flash drive under ubuntu so I can transfer stuff to it. I don't want to install the leapfrog bloatware, can someone help me with this? Additional Information: When I plug my crammer into my computer it shows a 1 MB file system with a link to download the crammer software. I want to know how to access the rest of the crammer's file system so I can transfer music to it. The crammer does not show any other partitions in natulius. According to an article on the internet, the crammed is divided into three partitions: One with a link to install the crammer software, one with all content(music, flash cards, etc.) and one for firmware. I want to know how to access the one with the content so I can add music to the player. Can anyone help me with this? Thanks in advance.

    Read the article

  • transfer Thunderbird (17) Profile on Win7 to Ubuntu 12.04

    - by William Curran
    I want to transfer Thunderbird Profile on Win7 to thunderbird (17) Ubuntu 12.04. I already copied the profile folder from Windows to Ubuntu and modified progile.ini on the ubuntu machine to include [Profile] Name=Bill IsRelative=1 Path=(the name of the transfered profile folder) I think the problem is that the Win. TB profile content (files and folder structure) look VERY different that the that of the unbuntu TB profile's that was created on installation. The Ubuntu install is new where as the Win TB has undergone many updates. Seems the system for profile storage has changed drastically. I tried to start TB in safe mode but could't get the path correct to start TB in the terminal with the -safe-mode switch. What can I do? Bill

    Read the article

  • Should I install ia32-libs or lib32stdc++ or can I just use --force-all for 32-bit printer driver

    - by William
    I got a Brother printer MFC class. The brother website only provides 32-bit drivers but I installed 64-bit Ubuntu. It says I need to install "ia32-libs" or "lib32stdc++" to install the 32-bit drivers onto 64-bit Ubuntu. Elsewhere I've read that I don't need to install these packages, I can just use --force-all when installing, but I don't know of the accuracy of this information. My questions: 1) do I HAVE to install "ia32-libs" or "lib32stdc++" or can I use --force-all to make 32-bit drivers install on 64-bit ubuntu? 2) if I do have to install "ia32-libs" or "lib32stdc++", which should I install? Which is better, which is recommended by ubuntu experts?

    Read the article

  • How to install ubuntu 12.04

    - by William A. Jordan
    I've had ubuntu on my pc for about 5 years,after the new 12.04 version and a day and a half trying to get it to just boot up. I will take it off my pc and rely on windows. I have 5 pc's which I built and am not an amateur, After installing it numerous times and even to run it from your webpage (to no avail). Granted I do have nvidia drivers on it, but after I went to their webpage and downloaded and installed the linux driver it,it still would not boot, by the way I took 2 different pc's apart and used what I thought were compatible (I shouldn't have to do this) parts. I have it on a seperate hd which I will remove and format. Have a nice day and so long (2 much trouble).

    Read the article

  • App not showing up in Google Play search on app name [on hold]

    - by William Jockusch
    About 30 hours ago, I released an app on Google Play. I am concerned that if you search on the exact app name, it does not show up in the results, even if you click "show more". https://play.google.com/store/search?q=free+graphing+calculator&c=apps It does show up if you put the name in quotes. But that's awfully low discoverability. https://play.google.com/store/search?q=%22free%20graphing%20calculator%22&c=apps Possibly relevant information: I had an earlier version with a different bundle ID. It was up for just an hour or so, and probably never actually visible to users. How can I fix this?

    Read the article

  • Xubuntu and other Debian based distros slow

    - by William V
    I have a Compaq Presario SR1950NX desktop computer with the AMD64 3800+ processor and 1GB ram and it seems that Ubunutu, Xubuntu and Lubuntu are all laggy. Things seem to be slow such as clicking on menus and opening programs and the UI renders in peices. When using the browser the system slows down considerably. I ran the TOP command and I do notice that xorg hits 30 to 40 percent cpu when running the browsers. I have tried these distros on a spare P4 machine and it is even worse. As long as I don't have a several things open at one time I can manage to get around although sluggishly. I also notice that I can't get debian based distros to install in 64bit (crtc6 failure) only in 32bit. Can anyone tell me what is it that I might be doing wrong? I have an integrated Nvidia card and have tried several of the recommended drivers which sometimes result in no boot screen upon reboot. Thanks

    Read the article

  • .Net Windows Service Throws EventType clr20r3 system.data.sqlclient.sql error

    - by William Edmondson
    I have a .Net/c# 2.0 windows service. The entry point is wrapped in a try catch block yet when I look at the server's application event log I seem a number of "EventType clr20r3" errors that are causing the service to die unexpectedly. The catch block has a "catch (Exception ex)". Each sql commands is of the type "CommandType.StoredProcedure" and are executed with SqlDataReader's. These sproc calls function correctly 99% of time and have all been thoroughly unit tested, profiled, and QA'd. I additionally wrapped these calls in try catch blocks just to be sure and am still experiencing these unhandled exceptions. This only in our production environment and cannot be duplicated in our dev or staging environments (even under heavy load). Why would my error handling not catch this particular error? Is there anyway to capture more detail as to the root cause of the problem? Here is an example of the event log: EventType clr20r3, P1 RDC.OrderProcessorService, P2 1.0.0.0, P3 4ae6a0d0, P4 system.data, P5 2.0.0.0, P6 4889deaf, P7 2490, P8 2c, P9 system.data.sqlclient.sql, P10 NIL. Additionally The Order Processor service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 60000 milliseconds: Restart the service.

    Read the article

  • Covariance and Contravariance on the same type argument

    - by William Edmondson
    The C# spec states that an argument type cannot be both covariant and contravariant at the same time. This is apparent when creating a covariant or contravariant interface you decorate your type parameters with "out" or "in" respectively. There is not option that allows both at the same time ("outin"). Is this limitation simply a language specific constraint or are there deeper, more fundamental reasons based in category theory that would make you not want your type to be both covariant and contravariant? Edit: My understanding was that arrays were actually both covariant and contravariant. public class Pet{} public class Cat : Pet{} public class Siamese : Cat{} Cat[] cats = new Cat[10]; Pet[] pets = new Pet[10]; Siamese[] siameseCats = new Siamese[10]; //Cat array is covariant pets = cats; //Cat array is also contravariant since it accepts conversions from wider types cats = siameseCats;

    Read the article

  • Does "Debug" invalidate ASP.Net MVC OutputCache?

    - by William Edmondson
    I have images stored in a database and am serving them from an MVC controller as "FileResult". If I run the MVC application from Visual Studio 2008 in debug mode and set a break point inside the controller method the debugger intercepts the call on every page refresh regardless of my "OutputCache" settings. Does the VS debugger invalidate the OutputCache or is there something else going on here? [OutputCache(Duration = 86400, VaryByParam = "id")] public FileResult Index(string id) { byte[] image; int imageId; int.TryParse(id, out imageId); using (var ctx = new EPEntities()) { var imageObj = (from images in ctx.Images where images.ID == imageId select images).FirstOrDefault(); image = imageObj.Image; } return new FileContentResult(image, "image/gif"); }

    Read the article

  • SQL Server Process Queue Race Condition

    - by William Edmondson
    I have an order queue that is accessed by multiple order processors through a stored procedure. Each processor passes in a unique ID which is used to lock the next 20 orders for its own use. The stored procedure then returns these records to the order processor to be acted upon. There are cases where multiple processors are able to retrieve the same 'OrderTable' record at which point they try to simultaneously operate on it. This ultimately results in errors being thrown later in the process. My next course of action is to allow each processor grab all available orders and just round robin the processors but I was hoping to simply make this section of code thread safe and allow the processors to grab records whenever they like. So Explicitly - Any idea why I am experiencing this race condition and how I can solve the problem. BEGIN TRAN UPDATE OrderTable WITH ( ROWLOCK ) SET ProcessorID = @PROCID WHERE OrderID IN ( SELECT TOP ( 20 ) OrderID FROM OrderTable WITH ( ROWLOCK ) WHERE ProcessorID = 0) COMMIT TRAN SELECT OrderID, ProcessorID, etc... FROM OrderTable WHERE ProcessorID = @PROCID

    Read the article

  • Entity Framework looking for wrong column

    - by m.edmondson
    I'm brand new to the Entity Framework and trying to learn all it can offer. I'm currently working my way through the MVC Music Store tutorial which includes the following code: public ActionResult Browse(string genre) { // Retrieve Genre and its Associated Albums from database var genreModel = storeDB.Genres.Include("Albums") .Single(g => g.Name == genre); return View(genreModel); } as I'm working in VB I converted it like so: Function Browse(ByVal genre As String) As ActionResult 'Retrieve Genre and its Associated Albums from database Dim genreModel = storeDB.Genres.Include("Albums"). _ Single(Function(g) g.Name = genre) Return(View(genreModel)) End Function The problem is I'm getting the following exception: Invalid column name 'GenreGenreId'. Which I know is true, but I can't for the life of my work out where it's getting 'GenreGenreId' from. Probably a basic question but I'll appreciate any help in the right direction. As per requested here is the source for my classes: Album.vb Public Class Album Private _title As String Private _genre As Genre Private _AlbumId As Int32 Private _GenreId As Int32 Private _ArtistId As Int32 Private _Price As Decimal Private _AlbumArtUrl As String Public Property Title As String Get Return _title End Get Set(ByVal value As String) _title = value End Set End Property Public Property AlbumId As Int16 Get Return _AlbumId End Get Set(ByVal value As Int16) _AlbumId = value End Set End Property Public Property GenreId As Int16 Get Return _GenreId End Get Set(ByVal value As Int16) _GenreId = value End Set End Property Public Property ArtistId As Int16 Get Return _ArtistId End Get Set(ByVal value As Int16) _ArtistId = value End Set End Property Public Property AlbumArtUrl As String Get Return _AlbumArtUrl End Get Set(ByVal value As String) _AlbumArtUrl = value End Set End Property Public Property Price As Decimal Get Return _Price End Get Set(ByVal value As Decimal) _Price = value End Set End Property Public Property Genre As Genre Get Return _genre End Get Set(ByVal value As Genre) _genre = value End Set End Property End Class Genre.vb Public Class Genre Dim _genreId As Int32 Dim _Name As String Dim _Description As String Dim _Albums As List(Of Album) Public Property GenreId As Int32 Get Return _genreId End Get Set(ByVal value As Int32) _genreId = value End Set End Property Public Property Name As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Public Property Description As String Get Return _Description End Get Set(ByVal value As String) _Description = value End Set End Property Public Property Albums As List(Of Album) Get Return _Albums End Get Set(ByVal value As List(Of Album)) _Albums = value End Set End Property End Class MusicStoreEntities.vb Imports System.Data.Entity Namespace MvcApplication1 Public Class MusicStoreEntities Inherits DbContext Public Property Albums As DbSet(Of Album) Public Property Genres As DbSet(Of Genre) End Class End Namespace

    Read the article

  • Fatal Error when using ADODB in VB6 on Windows Server 2003 SP2

    - by m.edmondson
    We've got a legacy app (VB6) which works fine on an old Windows Server 2003 box and has been for many years. Recently we've had to move it to a different physical location and in doing this we cloned the box with virtualisation and placed it elsewhere. In theory these two environments should be identical. On the new box however the app falls over when calling the RecordCount method of an ADODB.Recordset. I should say that I can successfully read the ADODB.RecordSet.Properties.Count property with no problem on the line before. The event viewer reports the following: Event Type: Error Event Source: Application Error Event Category: (100) Event ID: 1000 Date: 28/09/2012 Time: 11:15:27 User: N/A Computer: APP01 Description: Faulting application Control.exe, version 1.0.0.6, faulting module ntdll.dll, version 5.2.3790.4789, fault address 0x0002c6e4. I can only imagine there is something wrong with using ADODB within a virtualised environment. Any ideas?

    Read the article

  • How to perform this select?

    - by m.edmondson
    Say I have the simple table below: KeyWordID KeyWord ----------- ---------- 1 Blue 3 Yellow 1 Yellow How would I select the KeyWordID that selects the KeyWordIDs that where both KeyWord is Blue and Yellow. E.g. it should only return 1, as this is the only KeyWordID that has both Keywords Blue and Yellow I initially thought GROUPBY - but its not quite working as expected.

    Read the article

  • scrollTo (jQuery) won't work in firefox

    - by William
    For some reason, firefox seems to ignore my scrollTo function even though it works in chrome and safari. Here's an example link: http://blog.rainbird.me/post/2358248459/blowholes-are-awesome Chrome and Safari will automatically scroll to the top of the image (with an offset of 20 pixels) It doesn't work in firefox. I'm baffled! code: $(document).ready(function() { $(".photoShell img").lazyload({ placeholder: "http://william.rainbird.me/boston-polaroid/white.gif", threshold: 200 }); window.viewport = { height: function() { return $(window).height(); }, width: function() { return $(window).width(); }, scrollTop: function() { return $(window).scrollTop(); }, scrollLeft: function() { return $(window).scrollLeft(); } }; $(".photoShell img").hide(); $(".photoShell .caption").hide(); $(".photoShell img").load(function() { var maxWidth = viewport.width() - 40; // Max width for the image if(maxWidth > 960){ maxWidth = 960; } var maxHeight = viewport.height() - 50; // Max height for the image var ratio = 0; // Used for aspect ratio var width = $(this).width(); // Current image width var height = $(this).height(); // Current image height // Check if the current width is larger than the max if(width > maxWidth){ ratio = maxWidth / width; // get ratio for scaling image $(this).css("width", maxWidth); // Set new width $(this).css("height", height * ratio); // Scale height based on ratio height = height * ratio; // Reset height to match scaled image width = width * ratio; // Reset width to match scaled image } // Check if current height is larger than max if(height > maxHeight){ ratio = maxHeight / height; // get ratio for scaling image $(this).css("height", maxHeight); // Set new height $(this).css("width", width * ratio); // Scale width based on ratio width = width * ratio; // Reset width to match scaled image } $(this).parents('div.photoShell').css("width", $(this).width() + 22); $(this).parents('div.photoShell').addClass('loaded'); $(this).next(".caption").show(); var scrollNum = $(this).parents('div.photoShell').offset().top; $.scrollTo(scrollNum - 20, {duration: 700, axis:"y"}); $(this).fadeIn("slow"); }).each(function() { // trigger the load event in case the image has been cached by the browser if(this.complete) $(this).trigger('load'); });

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >