Panning on FullCalendar - fullcalendar

I am using http://arshaw.com/fullcalendar/ FullCalendar to display events in my project.
Everything works fine except when i try to set width in calendar to achieve panning functionality.
Basically, i want to display fullcalendar in full size (using agendaWeek) on PC and if i switch to tablet or re size the browser i want calendar to re-size up-to 500px or 600px and after that it should crop i.e. overflow-x hidden so that i can pan to see the events.
I tried fixing the width of my calendar like:
<div id="calendar" style="width: 750px; overflow: hidden;">
</div>
but instead it stopped re sizing the calendar. I am not sure how to give a start to solve this problem.

There is a <style> tag in the main source code, which defines the width. Use % instead of px should do the resizing trick.
As for panning, I believe it is done with CSS and JS. Here is an example, you can just alter it as necessary.
http://openlayers.org/dev/examples/pan-zoom-panels.html

Related

View full resolution on mobile device

Ive been on multiple website where onload where the website is zoomed out to keep resolution and therefore stopping overlaps on the mobile page.
Im not sure i am explaing my question correctly. As i am a new member, i will add links to the differences.
I have tried some css3 media queries and some meta tags i have found online but nothing is working for me at the moment.
Here is the link to my site:
http://conorpendlebury.com/
As you can see from the image below there is overlapping with the navigation bar which pushes the content too far giving a squished appearance.
http://conorpendlebury.com/Images/Screenshot.png
Are you trying to make your #Sidebar to overlap your #MainContent and #Footer when activated while #Bio wont squish?
If so, make your #MainContent and #Footer with position: relative and z-index: -1 and remove whatever is making their marginLeft equals to document.getElementById('Sidebar').style.width while activated.
If you intended to make it squished, you need a function to recalculate and reapply css to #MainContent and #Footer.
To build a offcanvas navigation you set the page to translateX the size of the navigation. So the container keeps the width.
Here is a example.
It's possible to code this without JavaScript.

bootstrap, grid and scrolling

I'm using bootstrap, angular and angular-ui-router
what I want to achieve is this mockup:
where the menu on the left is a navigation bar, a toolbar on the top, some breadcrumbs, content and a footer.
I can get all these elements in place. However, I need to populate the content with a variable number of elements from a rest data source. I want to wrap these nicely, so I am using the following angular / html
<div class="col-lg-12 ">
<div class="row">
<div class="col-md-4 " ng-repeat-start="item in $ctrl.items">
<div> card details here </div>
<div class="clearfix" ng-if="$index % 3 === 2"></div>
<div ng-repeat-end=""></div>
</div>
</div>
</div>
this works, and shows all the data. However, as there is more data than can fit into the div, scrollbars appear on the window
What I would like to acheive is to get the scrollbar to appear in the content div , like the screenshot
I have tried all sorts of css, like overflow: scroll-y, but can't figure it out.
Your problem seems to be related to dynamic heights. Using fixed heights (also %, vh, ... are useable), you can get that layout to work properly. There are a lot of solutions for that.
1. Using %
If you're going to use %, and that would by far be the best option, you have to start at the root tag which basically is <html>. After that you've to add the proper height value to it's child elements you want to use. Keep in mind to start at 100% and shrink your child element to the desired heights.
2. Using vh
The vh value is kinda same as %. You just don't need to set a height to every parent element. Demo
Note: You may have to check if that's working with your target browser.
3. CSS3 calc() function
Propably the newest method. You can calculate values through CSS(3), by using e.g. calc(100% - 100px). That's pretty cool though, but also isn't supported by every browser. See here.
4. Fixed layout
You could also use some fixed positionings. Setting up your footer, header and nav to position: fixed; would also keep up everything smooth and clean. I'd use a fixed layout in order to get that done, since I'd like it the most. Also it doesn't have any incompatibility with legacy browsers.
instead of overflow: scroll-y,
please try:
height:100%;
overflow-y:scroll
*giving it a height enables the scroll bar to appear.

rich:calendar positioning in css

Lets take a look on below images as example
As you see that in first case calendar cuts-off from the bottom. I've used <rich:calendar> ... </rich:calendar>
In first case my panel's height: 945px; (not enough height to adjust the calendar) but for second height: 1000px;. This is also come when I have not enough panel's width (like in mobile).
I am not free to change panel's height: 945px;.
panel is simple div having some height and width.
P.S: I tried z-index: 10; but it doesn't help me. I cannot provide JSFIddle because it doesnot support richfaces:calendar. What can I do for this?
I am using JSF 2.2 and richfaces 4.x.
rich:calendar is simple <table> inside <div>, there's no magic there.
Since you don't want to provide us code (even on multiple requests; and nobody here wants to guess), I'd try with increasing z-index in tag:
<rich:calendar zindex="4"/>
then with CSS
table.rf-cal-popup { z-index: 4; }
Four is what you need (default value is 3), but I don't know generated HTML, so you can increase it to some big number, like 1001. There must be something wrong with z-index, because rich:calendar always generates full calendar (full table with calendar).

Media Queries: Google Map not displaying right on window resize

I am using an adaptive layout on my site by using media queries.
Now when I resize the browser window past a certain media query, the google map displays faulty (see image)
What I do:
CSS:
#googleMap2{display: none;}
#media screen and (min-width: 919px){
#googleMap{display: none;}
#googleMap2{display: block;}
}
HTML:
<div id="googleMap">[google-map-v3 width="920" height="550" .......]</div>
<div id="googleMap2">[google-map-v3 width="768" height="320" .......]</div>
You need to let the map know it's been resized:
google.maps.event.trigger( map, 'resize' );
Call this on the resize event for your page or container.
With this approach you can use a single map and resize it as needed, instead of having to switch between two or more fixed size maps.
This fiddle has a working example. I don't know what the rest of your page layout will look like, but to illustrate one common layout I put a top bar and sidebar in the page, with the map filling the remaining space on the bottom right. Try resizing the page and you will see it in action.

Max-height (and aspect ratio) issue in Chrome, when I want to make an image gallery with floating height

A few weeks ago I working on this site. This is my next portfolio site. I want to make this structure, when I finish:
Header
Horizontal image gallery with floating height
Footer
I want to create something similar, just like the 22slides.com portfolio sites for photographers. If you change your browser's window size or press full screen button, the img element or the image's div automatically change his height.
I putted in the CSS a "max-height" parameter, to prevent the images never become bigger than their original resolution. It's a serious issue on huge resolution screens. but in Chrome it's not working properly, because the aspect ratios become wrong. If you press full screen, the aspect ratio more bad. In every other latest browser (Firefox, Safari, Opera, IE8-9) working normally. I created a custome CSS only for chrome with this command (but now I uncommented this in HTML to show you the Chrome aspect ratio problem):
#portfolio img { max-height: none; }
So with this line, the images using the biggest possible height in Chrome and the aspect ratios are correct. But it's a problem for me. I not want that a 1024x683px image showed bigger than his actual resolution on a FullHD monitor.
I think the best solution, if there's a javascript, which is dynamically escribe a width and height for every single image and keep the original aspect ratio. 22slides.com using something similar javascript, but I'm not a javascript programmer at all. :(
The images HTML structure:
<div id="portfolio">
<img src="image1.jpg" alt="" />
<img src="image2.jpg" alt="" />
</div>
CSS (max-height is very little number, just to show you the problem in Chrome):
#portfolio { white-space: nowrap; float: left; }
#portfolio img { height: 100%; width: auto !important; min-height: 150px; max-height: 350px; }
I'm using this Jquery Javascript to dynamically change the image's height and bring back the image's overflow on the screen with 130px negative height. Probably not this script causing the problem, becuase if I turn it off, the aspect ratios are more bad in Chrome:
// Dynamical vertical resizing on images and Correct the height (to not overflow the screen)
$(document).ready(function(){
$(window).load(function(){ // On load
$('#portfolio img').css({'height':(($(window).height())-130)+'px'}); // Adjust the number if you change something in CSS
});
$(window).resize(function(){ // On resize
$('#portfolio img').css({'height':(($(window).height())-130)+'px'}); // Adjust the number if you change something in CSS
});
});
I need help! Thank You!
Update:
This javascript written by "Emphram Stavanger" and "nick_w" seems to solve my image fit to browser height problem:
Imagefit vertically
I tried and it's perfectly working with one single image. The image fitting in the available viewport window perfectly, with correct aspect ratio! There is a visual explanation for our problem made by "Emphram Stavanger":
http://www.swfme.com/view/1064342
JsFiddle demo (Basicly it's Emphram Stavanger's code, I just putted in the changes by nick_W, changed Jquery to latest and I putted after the show link:
http://jsfiddle.net/YVqAW/show/
I not tried yet with horizontal scrolling image website, but it's already a big step!
UPDATE 2:
SOLUTION: https://stackoverflow.com/questions/20303672/horizontal-image-slideshow-javascript-not-working-properly-with-portrait-oriente
(And I need help again...) :)
A little late but you can use a div with background-image and set background-size: contain instead of an img tag:
div.image{
background-image: url("your/url/here");
background-size:contain;
background-repeat:no-repeat;
background-position:center;
}
Now you can just set your div size to whatever you want and not only will the image keep its aspect ratio it will also be centralized both vertically and horizontally.
The background-size property is ie>=9 only though.

Resources