I have a standard website, and when printed (for PDF-making purposes on Safari OS X), I'd like the footer to align to the bottom of whatever printed page it is on — i.e. the last page of the document.
Like this:
Is that possible?
I have used a media query (#media print { }) for all other print stylesheet details (excluded for simplicity).
Demo code is here; for the screen page itself, here is the HTML:
<div id="footer">
<p>A bunch of example stuff inside here...</p>
</div>
Which is situated with absolute positioning:
#footer {
color: #fff;
background: #000;
width: 100%;
position: absolute;
bottom: 0px;
}
Bit of an old one but the answer is surely to use the #page:last selector, but you have to alter the CSS for the footer as well.
#footer { position: static; }
#page:last {
#bottom-center { content:element(footer) }
}
I need to modify the image of primefaces rowToggler. This is what I'm trying in the css file:
.ui-datatable .ui-row-toggler {
cursor: pointer;
background-image: url("/resources/images/expand.jpg") ;
}
I have also tried changing the url to /images/expand.jpg, images/expand.jpg and simply expand.jpg. But none of them find the image.
What am I missing?
This is an old thread: adding an answer in case anyone else finds this on Google. The problem comes from the fact that the class used for adding the icon is hardcoded (see the source code) to be the class ui-icon-circle-triangle-e when the row is collapsed, and ui-icon-circle-triangle-s when the row is expanded. So the way to do this is to override the definitions of those classes in your style sheet. Here is what worked for me:
.ui-icon-circle-triangle-e {
background-image: url('../images/triangleRight.png') !important;
background-position: 0px 0px;
}
.ui-icon-circle-triangle-s {
background-image: url('../images/triangleDown.png') !important;
background-position: 0px 0px;
}
The defaults looked too much like simple bullet points - users were overlooking that they were clickable.
If you are putting your images inside the resources folder of your Project, you should access it like this:
.ui-datatable .ui-row-toggler {
cursor: pointer;
background-image: url("../javax.faces.resource/expand.jpg.xhtml?ln=images/") ;
}
The magical formula should be
../javax.faces.resource/<file-name>.xhtml?ln=<path-to-the-folder>/
So if your image is at /resources/car/bmw/series7.jpg, you should access it with ../javax.faces.resource/series7.jpg.xhtml?ln=car/bmw/
With the information you provided, its most likely because you have an app running on "localhost/APP_NAME/", and when you do "/resources/..." it points to "localhost/resources/..." which doesn't exist (it should resolve to "localhost/APP_NAME/resources/...".
Try this instead of url (its JSF specific)
url("#{resource['images:expand.jpg']}")
<script type="text/javascript">
/*<![CDATA[*/
$(document).on("click", ".ui-icon-circle-triangle-e", function() {
$(this).css({
background: 'url(#{request.contextPath}/images/data/silm.gif)'
});
});
/*]]>*/
</script>
<style type="text/css">
.ui-datatable .ui-row-toggler {
cursor: pointer;
background: url(#{request.contextPath}/images/data/eklem.gif) ;
}
</style>
If I write html to a Jquery UI dialog box it is naturally centred. I add a DIV and use some CSS ...
#printReport {
text-align: left;
font-family: Tahoma;
font-size: 12px;
width: 880px;
}
... and then
$("#printReport").empty().append(results);
to put text on the page - and it does what I want in FF/Chrome etc (left justified) ... but in IE (V7 and V8) the text is still centred.
Am I missing something?
Thanks
I am assuming some of the parent div's are set to be centered,
eiter by using the deprecated tag or by doing something like:
margin: 0 auto
in order to make it work you should do something like this:
body {
text-align: center
}
#printReport {
width: 880px;
margin: 0 auto;
text-align: left
}
hope that helps.
As per the comment, it was a problem in the CSS and nothing to do with dialog .. sorry
I'm trying to implement the latest sIFR. But I can't get even the simplest of tests to work. My test page is at http://www.kellymitchelljewelry.com/testsifr.asp. There should be an sIFR-generated line that says "2nd line" between the first and third lines. I'm using the examples provided on the sIFR page exactly.
My html looks like this:
<html>
<head>
<title>Kelly Mitchell Fine Jewelry</title>
<link rel="stylesheet" href="sifr.css" type="text/css">
<script src="sifr.js" type="text/javascript"></script>
<script src="sifr-config.js" type="text/javascript"></script>
</head>
<body>
First Line<br><br>
<h1>Second Line</h1>
<br>Third Line<br><br>
</body>
</html>
My sifr-config.js looks like this:
var cgoth = { src: 'cgoth.swf' };
sIFR.activate(cgoth);
sIFR.replace(cgoth, {
selector: 'h1'
});
My sifr.css file looks like this:
#media screen {
.sIFR-flash {
visibility: visible !important;
margin: 0;
padding: 0;
}
.sIFR-replaced, .sIFR-ignore {
visibility: visible !important;
}
.sIFR-alternate {
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
display: block;
overflow: hidden;
}
.sIFR-replaced div.sIFR-fixfocus {
margin: 0pt;
padding: 0pt;
overflow: auto;
letter-spacing: 0px;
float: none;
}
}
#media print {
.sIFR-flash {
display : none !important;
height : 0;
width : 0;
position : absolute;
overflow : hidden;
}
.sIFR-alternate {
visibility : visible !important;
display : block !important;
position : static !important;
left : auto !important;
top : auto !important;
width : auto !important;
height : auto !important;
}
}
/*
Place CSS rules for to-be-replaced elements here. Prefix by .sIFR-active
so they only apply if sIFR is active. Make sure to limit the CSS to the screen
media type, in order not to have the printed text come out weird.
*/
#media screen {
.sIFR-active h1 {
font-family: Verdana;
visibility: hidden;
line-height: 1em;
}
*/
I've tried recreating my swf file just in case I did something wrong, and closely followed the instructions to make sure I didn't leave anything out.
Can someone help me figure what I'm doing wrong?
Tom
I don't think your Flash movie is correct, opening it directly should show "Rendered with sIFR 3" text. Make sure it was exported correctly.
I have never been able to get a .swf file exported from Flash to work with sIFR. I've always ended up having to use the online sIFR generator: http://www.sifrgenerator.com/wizard.html
I don't know if my version of Flash (CS3) is just not compatible with sIFR or what... I do always save as version 8 like it says to, and make sure every setting is as it should be, but no luck. However, using that generator always seems to solve it. So if your Flash is jinxed to, you might want to give it a try.
I'm using the jQuery DatePicker control for the first time. I've got it working on my form, but it's about twice as big as I would like, and about 1.5 times as big as the demo on the jQuery UI page. Is there some simple setting I'm missing to control the size?
Edit: I found a clue, but it opens up new problems. In the CSS file, it states the component will scale according to the parent element's font size. They recommend setting
body {font-size: 62.5%;}
to make 1em = 10px. Doing this gives me a nicely sized datepicker, but obviously it messes up the rest of my site (I currently have font-size: .9em).
I tried throwing a DIV around my text box and setting its font size, but it seems to ignore that. So there must be some way to shrink the datepicker by changing the font of its parent, but how do I do that without messing up the rest of my site?
You don't have to change it in the jquery-ui css file (it can be confusing if you change the default files), it is enough if you add
div.ui-datepicker{
font-size:10px;
}
in a stylesheet loaded after the ui-files
div.ui-datepicker is needed in case ui-widget is mentioned after ui-datepicker in the declaration
I can't add a comment, so this is in reference to the accepted answer by Keijro. I actually added the following to my stylesheet instead:
div.ui-datepicker {
font-size: 62.5%;
}
and it worked as well. This might be preferable to the absolute value of 10px.
Not sure whether some body has suggested following way, if yes, just ignore my comments. I tested this today and it works for me. By just resizing the font before the control gets displayed:
$('#event_date').datepicker({
showButtonPanel: true,
dateFormat: "mm/dd/yy",
beforeShow: function(){
$(".ui-datepicker").css('font-size', 12)
}
});
Using the callback function beforeShow
I change the following line in ui.theme.css:
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
to:
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 12px; }
Add
div.ui-datepicker, .ui-datepicker td{
font-size:10px;
}
in a stylesheet loaded after the ui-files.
This will also resize the date items.
For me, this was the easiest solution:
I added the font-size:62.5%; to the first .ui-datepicker tag in the jquery custom css file:
before:
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none;}
after:
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; font-size:62.5%; }
I was trying these examples without success. Apparently other stylesheets on the page were setting default font sizes for different tags. If you adjust the ui-datepicker you are changing a div. If you change a div you need to make sure the contents of that div inherit that size. This is what finally worked for me:
<style type="text/css">
.ui-datepicker-calendar tr, .ui-datepicker-calendar td, .ui-datepicker-calendar td a, .ui-datepicker-calendar th{font-size:inherit;}
div.ui-datepicker{font-size:16px;width:inherit;height:inherit;}
.ui-datepicker-title span{font-size:16px;}
</style>
Good luck!
I was using an input to collect and show the calendar, and to be able to resize the calendar I have been using this code:
div.ui-datepicker, .ui-datepicker input{font-size:62.5%;}
It works like a charm.
$('.ui-datepicker').css('font-size', $('.ui-datepicker').width() / 20 + 'px');
This worked for me and seems simple...
$(function() {
$('#inlineDatepicker').datepicker({onSelect: showDate, defaultDate: '01/01/2010'});
});
<div style="font-size:75%";>
<div id="inlineDatepicker"></div>
</div>
with out changing the css file you can also change the calendar size by putting the the following code in to ur <head>.....</head> tag:
<head>
<meta charset="utf-8" />
<title>jQuery UI Datepicker - Icon trigger</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style type="text/css">
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 0.6em; }
</style>
<script>
$(function() {
$( "#datepicker" ).datepicker({
//font-size:10px;
//numberOfMonths: 3,
showButtonPanel: true,
showOn: 'button',
buttonImage: "images/calendar1.gif",
buttonImageOnly: true
});
});
</script>
</head>
I tried the approach of using the callback function beforeShow but found I had to also set the line height. My version looked like:
beforeShow: function(){$j('.ui-datepicker').css({'font-size': 11, 'line-height': 1.2})}
the best place to change the size of the calendar is in the file jquery-ui.css
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Verdana,Arial,sans-serif;
font-size: .7em; /* <--default is 1.1em */
}
This code will work on Calender buttons.
size of numbers will increase by using "line-height".
/* Change Size */
<style>
.ui-datepicker{
font-size:16px;
line-height: 1.3;
}
</style>
you can change jquery-ui-1.10.4.custom.css as follows
.ui-widget
{
font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
font-size: 0.6em;
}
Another approach:
$('.your-container').datepicker({
beforeShow: function(input, datepickerInstance) {
datepickerInstance.dpDiv.css('font-size', '11px');
}
});
$('div.ui-datepicker').css({ fontSize: '12px' }); work if we call it after
$("#DueDate").datepicker();
Fiddle
The Jacob Tsui solution works perfect for me:
$('#event_date').datepicker({
showButtonPanel: true,
dateFormat: "mm/dd/yy",
beforeShow: function(){
$(".ui-datepicker").css('font-size', 12)
}
});
We can alter in the default 'jquery-ui.css' file as below given code:
div.ui-datepicker {
font-size: 80%;
}
However, changing the default 'jquery-ui.css' file is not recommended as it might have been used somewhere else in the project. Changing values in the default file can alter datepicker font in other webpages where it has been used.
I used the below code to alter "font-size". I placed it just after datepicker() is called as shown below.
<script>
$(function () {
$( "#datepicker" ).datepicker();
$("div.ui-datepicker").css("font-size", "80%")
});
</script>
Hope this helps...
I think I found it - I had to go into the CSS file and change the font-size for the datepicker control directly. Obvious once you know about it, but confusing at first.
open ui.all.css
at the end put
#import "ui.base.css";
#import "ui.theme.css";
div.ui-datepicker {
font-size: 62.5%;
}
and go !
To get this to work in Safari 5.1 with Rails 3.1, I had to add:
.ui-datepicker, .ui-datepicker a{
font-size:10px;
}
I had datepicker appearing in a modal and because of the "date-display-container" on the left hand side, the calendar was partially out of view, so I added:
.datepicker-date-display {
display: none;
}
.datepicker-calendar-container {
max-height: 21em;
}
.datepicker-day-button {
line-height: 1.2em;
}
.datepicker-table > thead > tr > th {
padding: 0;
}