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

responsive css #17

Closed
ghost opened this issue Apr 10, 2015 · 18 comments
Closed

responsive css #17

ghost opened this issue Apr 10, 2015 · 18 comments

Comments

@ghost
Copy link

ghost commented Apr 10, 2015

The display of PDF/Video is not nicely displayed on small devcies phones The PDF/Video becomes a box with sliders .

@media only screen and (min-width: 480px) and (max-width: 767px) { }
@media only screen and (max-width: 479px) { }

@ritz078
Copy link
Owner

ritz078 commented Apr 10, 2015

Can you post a screenshot ?

@ghost
Copy link
Author

ghost commented Apr 10, 2015

01

@ghost
Copy link
Author

ghost commented Apr 10, 2015

Vines stays to width..
02

@ghost
Copy link
Author

ghost commented Apr 10, 2015

03

@ritz078
Copy link
Owner

ritz078 commented Apr 10, 2015

For vine there is an option to set its width .
Writing the pdf/video css based on the device width is not great always because sometimes that is not taking the full device width and is wrapped inside a div of somewhat lesser width than the device's width. That will create problems for the user.

So better you write your own css based on the div width in which you are using the plugin and not the device width.

@ritz078
Copy link
Owner

ritz078 commented Apr 10, 2015

You can always add your css over the default one according to your needs. If you have some solution that will be consistent in all cases then only it can be implemented in the plugin.

@ghost
Copy link
Author

ghost commented Apr 10, 2015

Thnx. fixed it by getting the class width and parsing it true embed.js

var width = $('.forum').width();    
var $window = $(window);           

$window.resize(function resize(){
    var width = $('.forum').width();
});

For the pdf and youtube i will create custom css for phones.

@ritz078
Copy link
Owner

ritz078 commented Apr 10, 2015

Can you send a PR ?

@ghost
Copy link
Author

ghost commented Apr 10, 2015

What is a PR :P

@ritz078
Copy link
Owner

ritz078 commented Apr 10, 2015

Its Pull Request. see this

@ghost
Copy link
Author

ghost commented Apr 10, 2015

Never did it before. Ill read it as soon as !

@ritz078
Copy link
Owner

ritz078 commented Apr 10, 2015

Though your solution will work but i will have to include this responsiveness code inside the plugin as on each resize your code will reload the whole content. This means repeated http requests. Thats never good. I will see what i can do.

@ghost
Copy link
Author

ghost commented Apr 10, 2015

can you also set in your next release the hight of the iframe fore VINE + 2 pixels? 158 seems te be to short for the last borderline from Vine

opts.vineOptions.width + 160

@ghost
Copy link
Author

ghost commented Apr 10, 2015

currently working on a iframe refresh after resize window, i added class="ejs-vine-iframe" on the iframe:

   var width = $('.element').width()-21;    
var $window = $(window);           

$('.ejs-vine-iframe').css({'width': width});        

$window.resize(function resize(){
    var width = $('.element').width()-21;
    $('.ejs-vine-iframe').css({
        'width': width,
        'height': width+160,
    });  
    $('.ejs-vine-iframe',window.parent.document).attr('src',$('.ejs-vine-iframe',window.parent.document).attr('src'));
});

@ghost
Copy link
Author

ghost commented Apr 16, 2015

If default size is 500 for vine, and opening page with vine on smaller device the vine width is 500px.

resizing from large window to smaller works, vine shrinks too. but when resizing from very small to big window the vine does not resize bigger anymore,

maybey it's an solution to get the width of the element div and take a amount of pixels to lower the width. when resizing then always resize the vine box too.

@ritz078
Copy link
Owner

ritz078 commented Apr 16, 2015

Actually here width that you set is maxWidth but i guess yours solution seems better .I will fix this

  • When there is no width set it will take the width of whole div

@ritz078 ritz078 reopened this Apr 16, 2015
ritz078 added a commit that referenced this issue Apr 16, 2015
ritz078 added a commit that referenced this issue Apr 16, 2015
@ritz078
Copy link
Owner

ritz078 commented Apr 16, 2015

Now there are slight change in options

vineOptions:{
            maxWidth:500,
            type:'postcard',         //'postcard' or 'simple' embedding
            responsive:false         // whether to make the vine embed responsive
      },

I guess you can understand the function about how it works. If not do reply here. I am closing this issue now.

@ritz078 ritz078 closed this as completed Apr 16, 2015
@ghost
Copy link
Author

ghost commented Apr 16, 2015

thank you for this :)

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

1 participant