colelawrence / Touch-Splitter-jQuery

A high performance html splitter compatible with touch events
14 stars 7 forks source link

Splitter bar width option #5

Closed silverwind closed 10 years ago

silverwind commented 10 years ago

I'd like to be able to either set the width dynamically through CSS, or at least have an config option for it.

Ideally, the script should adapt the splitted elements sizes when the width changes, which may be a bit hard, but I guess a simple px or em-based config option should suffice as a start.

colelawrence commented 10 years ago

Can you describe how this would be stated in the options parameter?

For example:

{
  "minSizeBarThickness": {
    "300": "10", // if splitter distance < 300px then bar thickness = 10px
    "600": "20" // if splitter distance < 600px then bar thickness = 20px
  }
}
colelawrence commented 10 years ago

Or if it isn't in options parameter, would we prefer something like this in the css:

.TouchSplitter.h-ts .splitter-bar.sm {
    width: 10px
}
.TouchSplitter.h-ts .splitter-bar.md {
    width: 15px
}
.TouchSplitter.h-ts .splitter-bar.lg {
    width: 20px
}

Where a class would be applied to the splitter bar describing its size.

silverwind commented 10 years ago

Hmm, what about a simple width: 10 option? I think three classes just for different widths would over-complicate things.

In CSS, I'd ideally want to have a single .TouchSplitter.h-ts .splitter-bar class to set width, and ideally, with needing to use !important.

colelawrence commented 10 years ago

Oh, yes. That should be easy to implement.

colelawrence commented 10 years ago

option: { thickness: value } Example values: "13px" 30(px) "2em" "1.5em"