Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not wrap everything in a container for responsive? #102

Open
Jakobud opened this issue Sep 16, 2015 · 3 comments
Open

Why not wrap everything in a container for responsive? #102

Jakobud opened this issue Sep 16, 2015 · 3 comments

Comments

@Jakobud
Copy link

Jakobud commented Sep 16, 2015

Instead of creating your span next to the select like this:

<select class='hasCustomSelect'..../>
<span class='customSelect'>...</span>

Why don't you wrap everything into a containing element

<span class='customSelectContainer'>
  <select class='hasCustomSelect'..../>
  <span class='customSelect'>...</span>
</span>

And then make the .customSelect and select width: 100%? That way the user can easily just make the container responsive in whatever way they want and both the select and the customSelect will stay exactly the same size as the container using simple css?

Honestly its kind of weird you put it parallel to the select in the DOM and then you try to manage the width of each element by itself using javascript...

@deansimcox
Copy link

I agree with you there.

You could do this yourself when initializing though?
$('.selector').wrap('<div class="customSelectContainer"/>').customSelect();

@Jakobud
Copy link
Author

Jakobud commented Sep 17, 2015

Yeah I'm doing something like that already. I was just curious as to why the plugin wouldn't do something so obvious instead of using JS to hardcode widths.

@massic80
Copy link

I also thought the same, but implementing the modification would create
compatibility issues with previous installations (and CSS).
I think the solution would be a switch parameter for activating this mode
Massi

2015-09-17 3:33 GMT+02:00 Jake Wilson [email protected]:

Yeah I'm doing something like that already. I was just curious as to why
the plugin wouldn't do something so obvious instead of using JS to hardcode
widths.


Reply to this email directly or view it on GitHub
#102 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants