• Stars
    star
    755
  • Rank 60,125 (Top 2 %)
  • Language
    JavaScript
  • License
    Other
  • Created almost 14 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Columnizer jQuery Plugin will automatically layout your content in newspaper column format. You can specify either column width or a static number of columns. And, of course, it’s easy to use!

Support

Has Columnizer saved you hours? Become a Github Sponsor and buy me a coffee ☕️ 😄

Documentation

CSS Classes for Created Columns

Columnizer will add CSS classes to the columns it creates. Each column will have a "column" classname. The first column will have "first" and last column will have "last". This lets you target specific columns in your CSS markup more easily.

Options

. Default is false.
Option Name Purpose
width a rough width your columns, and Columnizer will create as many as will fit in the browser window
height This option can only be used in conjunction with the width option. When both the width and height options are set, columns will continue to be built to those measurements to fill all of the content. This is useful for scrolling columns horizontally. See sample 5 for an example.
columns an alternative to the width option. Sets a static number of columns to build, regardless of widget.
target An optional CSS selector may be used here to determine where the columnized content should be placed. If a target is specified, the columnized node will remain unchanged, and the target node will contain columnized content.
doneFunc This function will be called when columnizing is complete.
ignoreImageLoading
true by default. If set to false, Columnizer will try to wait until images in the content have loaded before columnizing the data.
columnFloat default is “left”. Change to “right” for right to left languages.
lastNeverTallest
false by default. Set to true to ensure that the last column of the columnized content is not the tallest column.
buildOnce if buildOnce is false, the content will be re-columnized when the window is resized. If buildOnce is true, the content will only be columnized once.
overflow If this option is used, then a static height is set to the columnized content, and any content that does not fit within the height is put into the element specified by $(id). See demo 1 for an example.
height (required): the static height for the columnized content
id (required): The id of the element to put the remainder of the content
doneFunc (optional): a function to be called after the content has been columnized. This is a great place to columnize the remainder content.
manualBreaks Defaults to false. Set to true if you only want to create columns with manual column breaks. If true, then width, height, columns options are ignored.
disableSingle Disables single column layout if number of columns is less or equal to 1. Useful to force columns scrolling horizontally on small screens. See demo 5 for an example.

CSS Classes

Class Name Purpose
columnbreak Any node that has the CSS class “columnbreak” will act as a column break, as you'd expect in any word processor. The "columnbreak" node will always be the last node in its column. Works well with the optional "columnBreak" option.
dontsplit Any node that has the CSS class “dontsplit” won’t be split into multiple columns. This is handy to make sure that tables, etc, aren’t chopped in half if they land at the bottom of a column.
dontend Any node that has the CSS class “dontend” will never be put at the end of a column.
removeiffirst Any node that has the CSS class “removeiffirst” will be removed from the content if it is the first node in a column.
removeiflast Any node that has the CSS class “removeiflast” will be removed from the content if it is the last node in a column.

Helpful Hints

  1. You can specify a rough width your columns, and Columnizer will create as many as will fit in the browser window. Just use: $(‘selector’).columnize({width: 400 }) syntax
  2. You can specify a specific number of columns, and Columnizer will distribute your content between that many columns. Just use: $(‘selector’).columnize({columns: 2 }) syntax
  3. When using the width and height options to scroll horizontally, make sure that the .column CSS class does not specify any padding or margin or border. See CSS for sample 5 for an example on how to create buffer between columns.
  4. Make sure that you are columnizing visible content. If your content is display:none it may not columnize correctly. Try visibility:hidden and display:block instead.
  5. Columnizer does not auto-class any of your content. See the Suggested Defaults For Your Content section.

Suggested Defaults For Your Content

Columnizer does not add default "dontsplit" or "dontend" classes to your content. If you are finding your content is breaking columns at awkward locations, try the following:

 $yourContent.find('table, thead, tbody, tfoot, colgroup, caption, label, legend, script, style, textarea, button, object, embed, tr, th, td, li, h1, h2, h3, h4, h5, h6, form').addClass('dontsplit');
 $yourContent.find('h1, h2, h3, h4, h5, h6').addClass('dontend');
 $yourContent.find('br').addClass('removeiflast').addClass('removeiffirst');

Uncolumnize

You can revert your columnized DOM by using the "uncolumnize" function.

$('selector').uncolumnize();

Troubleshooting

Why isn't my content columnizing?

Make sure that your content "has display". If the content you're columnizing has display:none, then the browser has difficulty estimating the size of some nodes, which makes columnizing impossible. instead of display:none, use visibility:hidden and keep display:block. then in the doneFunc() of columnizer, change the visibility and display to whatever your page or application needs.

Additional Notes

Minimize

To compress into a zip file, run compress.sh

Bug report?

Check the issues on the GitHub page

More Repositories

1

app-launch-guide

This aims to be an indie dev's definitive guide to building and launching your app, including pre-launch, marketing, building, QA, buzz building, and launch. More info at:
3,926
star
2

loose-leaf

Intuitive note taking app. Import and annotate PDFs, manipulate imported photos with intuitive gestures, and take notes with Apple Pencil.
Objective-C
586
star
3

PerformanceBezier

A small library to dramatically speed up common operations on UIBezierPath, and also bring its functionality closer to NSBezierPath
Objective-C
356
star
4

JotUI

OpenGL based drawing view built for and used by Loose Leaf for iPad
Objective-C
261
star
5

ClippingBezier

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
Objective-C
238
star
6

json-to-mysql

Easily take any JSON object and create+insert it into a mysql table built from its structure. Also search, update, index, and validate tables with JSON.
PHP
134
star
7

ios-hand-shadows

Add shadows to your gestures for better demo videos of your app
Objective-C
121
star
8

PowerPointToUIImage

Objective-C code to generate UIImage thumbnails from slides in a PowerPoint (ppt) file
Objective-C
56
star
9

cloudkit-manager

A simple functional example of building messaging for your app on top of CloudKit.
Objective-C
51
star
10

ios-uitouch-bluedots

Simple code to add blue dots for every UITouch in an app - Helpful for recording app demos that show touch locations during use.
Objective-C
51
star
11

Inkable

Swift
41
star
12

Clocks

Swift implementations of a Lamport clock, hybrid logical clock, and a vector clock.
Swift
29
star
13

automatic-php-api

A barebones PHP API for the Automatic API
PHP
24
star
14

DrawUI

A variety of methods for making a drawing canvas UIView for iPhone and iPad. Objective-C.
Swift
19
star
15

MMStretchGestureRecognizers

A collection of three gestures that can stretch an arbitrary view with four fingers. Used in getlooseleaf.com's clone gesture.
C++
18
star
16

touch-chart

Simplify and smooth UIBezierPaths by reducing the number of elements within the path.
Objective-C
15
star
17

DrawKit

git mirror of DrawKit OS X framework from http://apptree.net/drawkit.htm
Objective-C
15
star
18

spare-parts-app

Simple 2D point and line physics using Verlet integration. Port and fork of https://www.youtube.com/watch?v=tAd7ttKbugA.
Objective-C
14
star
19

vectorboolean

Github clone of https://bitbucket.org/andyfinnell/vectorboolean
Objective-C
13
star
20

PonyExpress

Type-safe NotificationCenter alternative for Swift
Swift
8
star
21

PageCollectionView

Collection view controller, view, and layouts for pinching from book view, to page grid, to full screen page.
Swift
7
star
22

stanford-postagger-objc

This is an Objective-C port of Stanford's Java Part-of-Speech Tagger for iOS
Objective-C
7
star
23

chili58

A choc-spaced version of the Lily58 mechanical keyboard.
6
star
24

jotbook

PHP
6
star
25

chrome-stream-chat

a simple Chrome extension to combine youtube + livecoding + twitch chat
Objective-C
4
star
26

old-khan

This is a version of Khan Academy cerca 2010 and should be taken as an old reference only. this code is not maintained. For up to date Khan Academy code, look at:
JavaScript
3
star
27

bezier-curve-ios-examples

a simple project that shows different bezier curve drawing/clipping/masking examples
3
star
28

easy-php-app

A barebones PHP app that uses Twitter OAuth for user login and https://github.com/adamwulf/json-to-mysql for database access.
PHP
2
star
29

Locks

NSLock alternatives from https://www.vadimbulavin.com/atomic-properties/
Swift
2
star
30

neuralnet

A super simple neural network written in c++ from the tutorial by @BobbyAnguelov
C++
2
star
31

MMToolbox

A little bitty collection of Objective-C helper categories and classes
Objective-C
2
star
32

SwiftPGN

Basic chess pgn parser in Swift
Swift
2
star
33

verlet-nn

A simple CPU based educational neural net, with neuron visualizations using verlet integration.
Objective-C
2
star
34

SKDraw

An example SKView that renders a scene with two bezier path lines, one as a blue line, and one as eraser
Objective-C
2
star
35

twitter-manage

A simple twitter app that can help automatically manage followers
PHP
2
star
36

PaperPile

A swift reimplementation of Loose Leaf's core feature set
Swift
1
star
37

drivesafetogether

PHP
1
star
38

ARC-dealloc-self

This repository explains how and when an object might be dealloc'd inside of one of its own methods, and provides alternative implementations that would not exhibit this memory bug.
Objective-C
1
star
39

MMPageManager

Objective-C
1
star
40

Caches

Swift datastructures for caching, a wrapper around NSCache and dictionary with weak values
Swift
1
star
41

GLPaint

Both OpenGL ES 1.1 and OpenGL ES 2.0 versions of Apple's GLPaint app
Objective-C
1
star
42

nswindow-nsscreen-restoration

Simple project showing window origin will restore, but the screen will not restore
Objective-C
1
star
43

SwiftTex

A very simple Latex parser and math expression simplifier
Swift
1
star
44

QuadTree

A simple Swift implementation of a QuadTree data structure
Swift
1
star
45

simplenn

Bare bones neural network written in Objective-C, based off of the tutorial: http://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/
Objective-C
1
star