Skip to main content

Install

Requires jQuery 4.0 or later.

Setup

The plugin needs to be installed onto jQuery. There are two ways to do this:

Auto-install (global jQuery)

If jQuery is available on window, the plugin installs itself automatically on import:

Manual install (ES modules)

When using a bundler, import and call install with your jQuery instance:

Basic Usage

The plugin renders normalized <img> elements into the selected container with visual center alignment and a fade-in transition.

Plugin Options

All shared options are supported, plus these jQuery-specific ones:

Methods

Call methods on an existing plugin instance using the standard jQuery plugin convention:

process

Update the logos or options on an existing instance:

ready

Returns a native Promise that resolves with the normalized logos when processing completes:
If logos are already processed, the promise resolves immediately. If processing fails, the promise rejects with the error.

destroy

Removes the plugin instance, cleans up the engine, and empties the container:

instance

Returns the internal plugin instance (engine, unsubscribe function, current options) for the first matched element. Useful for advanced use cases:

Full Example

Dark Mode

Pass backgroundColor for proper contrast detection on opaque logos:

Chaining

The plugin supports standard jQuery chaining for initialization, process, and destroy:
The ready method breaks the chain since it returns a Promise instead of a jQuery object.

Re-initialization

Calling .logoSoup({...}) on an element that already has an instance automatically destroys the old instance and creates a new one:

How It Works Under the Hood

The jQuery adapter is a standard $.fn plugin that:
  • Stores the engine instance via $.data() on each element
  • Subscribes to the engine’s state changes and renders <img> elements into the container using DOM APIs
  • Applies getVisualCenterTransform for visual center alignment
  • Uses native Promise for the ready method (jQuery 4 slim build dropped Deferreds in favor of native Promises)
  • Cleans up blob URLs and subscriptions on destroy