sIFR - line height issue in Firefox 3 only? - firefox

I'm trying to use sIFR to create a tag cloud effect for a homepage I'm working on. There are 4 lines of text, with various font sizes and font colours within each line.
I suspect sIFR purists would say this creates too many movie clips to be safe, but it really is the effect we're looking for and it's the best option we have which is good for SEO and will degrade gracefully. If we can get it working, that is...
The problem I'm having is that the colours, font sizes, etc. all display just fine, but there seems to be excessive padding around the text, creating the effect that the line-height is nearer 200% than 200% or 1 em. I've got it working OK in Internet Explorer 7 and some other browsers, but Firefox seems to be displaying everything all wrong!
Any ideas and help appreciated ;)
<h1 style="font-weight:600;">
<span class="titleleft">Content </span>
<span class="titleright">Formula:</span>
<span class="focussed">Focused </span>
<span class="creative">creative </span>
<span class="and">and </span>
<span class="targeted">targeted </span>
<span class="content">content </span>
<span class="for">for </span>
<span class="bluechip">blue chip </span>
<span class="global">global </span>
<span class="websites">websites </span>
<span class="and2">and </span>
<span class="intranets">intranets. </span>
<span class="wedeliver">We deliver </span>
<span class=success>success </span>
<span class="witha"> with a </span>
<span class="degree">360 degree </span>
<span class="approach">approach to online</span><br />
<span class="communications">communications.</span>
</h1>
Sample configuration line:
sIFR.replace(arial,
{selector: '#main_content_left_home>h1>span.titleleft'
,css: '.sIFR-root { color: #000000; font-weight:bold;letter-spacing: -1;}'
,tuneWidth: (+10)
});
sIFR.fixWrap = false;
sIFR.fitExactly = true;
sIFR.useStyleCheck = false;
sIFR.useDomLoaded = false;
sIFR.preserveSingleWhitespace = true;
sIFR.autoInitialize = true;
sIFR.forceWidth = true;
sIFR.repaintOnResize = true;

Check whether the extra size is inside the Flash movie, or around it. In the latter case, you'll have to resort to CSS tweaking.
In the former case, check out the tuneHeight / tuneWidth and offsetTop / offsetLeft arguments for sIFR.replace(). These let you change position of the text inside the Flash movie and let you change how much margin the Flash movie leaves around the text.
This is sometimes necessary because the dimensions of the text are reported incorrectly by Flash.

Related

Trying to get Image cover adjacent to text in section of bootstrap

I'm trying to have a Bootstrap section that's 1/2 UL & 1/2 image. The code works fine at full screen, but when I start reducing the size of the screen the image begins to shrink & show the section's background (see images). hot can I go about having the image always remain full cover in 1/2 of the section until it reaches the break point # small width? Thanks for any help you can give!!
Full Screen works fine | Image begins to "break" around medium | Works fine again at small screen
<section class="bg-primary-cut" id="cuts">
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-lg-offset-2">
<h2 class="section-heading-cuts text-uppercase">Pup List</h2>
<hr class="light">
<ul class="ul-cuts">
<li>Short one </li>
<li>Short one </li>
<li>a little bit longer one </li>
<li>short one </li>
<li>also a tad bit longer </li>
<li>last shortie </li>
</ul>
</div>
<div class="col-lg-6">
<img class="media-object img-responsive" src="https://unsplash.it/1200/600?image=1062" height="500">
</div>
</div>
</div>
</section>
Set the height of the image to 100% so it will fill. Although it may skew it out of proportion.
OR you can see at which point it starts to break and set different styles for that breakpoint with media queries to override bootstraps sm/md/lg breakpoints.

Date Filters in DC.js

I am working with DC.js and I am trying to add preset date filters to this jsfiddler.
<div id="header" class='row logoSize'>
<img src="logo-main2.png" />
<div class="buttons-container"></div>
<div class="startEnd" id="start">2015-02-12</div>
<div class="startEnd" id="end">2015-02-17</div>
<div class="startEnd" id="brushYears">gggg</div>
</div>
<div class='row '>
<div class="dc-data-count">
<h2>
Card Activity Report
<span>
<span class="filter-count"></span>
selected out of
<span class="total-count"></span>
records
<span id="titleCount"></span>
<a class="btn btn-sm btn-success" href="javascript:dc.filterAll(); dc.renderAll();">Reset All</a>
</h2>
</div>
</div>
<div class='row'>
<div class='span12' id='dc-time-chart'>
<h4>
Activity counts per Day
<span class="muted pull-right" style="margin-right: 115px; ">From the chart below select a date range to filter by
<a class="reset btn btn-sm btn-success"
href="javascript:timeChart.filterAll();dc.redrawAll();"
style="display: none;">
reset
</a>
</span>
</h4>
</div>
<div class="clearfix"></div>
</div>
<div class="row">
<div id="daily-move-chart">
<div class="clearfix"></div>
</div>
</div>
</div>
<pre id="data">
ID,Action,AuditDate,DataProvider,MachineName,UserName,PersonID,Count
I have got the brush extent to move but I can't get it to trigger the filtering.
I tried moveChart.redraw(); dc.redrawAll(); dc.renderAll();, and a few others with no luck. I have seen examples using just D3, and the logic gets hard to follow as I am trying to understand what a group object in DC would be in D3. Where I get lost is understanding the Brush Events especially with DC. I can't find any DC sample that works with the brush like this. Can someone notice what I am missing to make this work DC?
I think the main problem here is that you are mixing straight d3 code with dc.js code. You don't need to create your own brush object when using dc.js, because it already creates one, and the .filter() method is already tied to the brush that it uses.
You also don't need to filter the data yourself, because that's exactly what crossfilter is for. It looked like you were filtering the original data array, which has no effect because crossfilter has already copied it into its internal buffers.
The other trick is to use the dc.filters.RangedFilter object when filtering, so that dc.js knows that a range is intended and not two discrete dates.
So, instead of most of the body of your drawBrush function, just do
timeChart.filter(null);
timeChart.filter(dc.filters.RangedFilter(new Date(st), new Date(end)));
dc.redrawAll();
And also remove the extra, unneeded brush.
Working fork of your fiddle here: https://jsfiddle.net/gordonwoodhull/mr56bswz/1/
I'd also add that this is not really the right way to do range/focus charts, so please use other examples for that - this is mostly an example of how to apply date ranges.
The strange behavior of the range chart filtering itself, and staying filtered after it's been reset, comes from the focus chart using a different dimension form the range chart - ordinarily you want them on the same dimension so they don't observe each other. But that wasn't the focus of this question, which is already a couple of years old, so I'm not going to fix that now.

image (img) within anchor (a) not rendering correctly

I am trying to understand what I'm doing wrong,
I have two elements, image withing anchor with no style.
some how the anchor dose not cover the image area.
example: http://jsfiddle.net/L4ShV/1/
<a href="javascript:void(0)" id="downloadLink" >
<img src="http://toonimo.com/testing/clients_tests/somoto/flv_player/images/nlp/free_download_btn.jpg" border="0" style="width: 373px;height: 120px;" />
</a>
<div>
<h1>a dimantions:</h1>
width: <span id='width_c'></span><br>
height: <span id='height_c'></span><br>
<br>
when clearly its not possible!
How can i get the Real height?
</div>
<script>
var el = document.getElementById('downloadLink');
document.getElementById('width_c').innerHTML = el.offsetWidth;
document.getElementById('height_c').innerHTML = el.offsetHeight;
</script>
any reason or solution for this problem?
That is a normal behaviour of anchor as it expects for block-level elements. You can float a to cover the image.
<a href="javascript:void(0)" id="downloadLink" style="float:left">

Put 3 text under one image

I have this image http://s23.postimg.org/on361znhn/Transform_Marketing.png
and I want to put 3 colored and centered (learn more) texts under each image. I tried this:
<p>
<span style="float:left;margin-left:100px;margin-right:40px"> Learn More</span>
<span style="float:left;margin-left:170px;margin-right:40px"> Learn More</span>
<span style="float:left;margin-left:120px;margin-right:40px"> Learn More</span>
</p>
but the link is not working. I want an option to change (learn more) text colour and font size and have it centered under each image.
Thank you for help.
to center each text below its image, the below code should help:
<div style="text-align:center; margin-right:5px; margin-left:5px;">
<img src="img1.png"><br />learn more
</div>
<div style="text-align:center; margin-right:5px; margin-left:5px;">
<img src="img2.png"><br />learn more
</div>
<div style="text-align:center; margin-right:5px; margin-left:5px;">
<img src="img3.png"><br />learn more
</div>
Hope it helps.
Update (in case only one image):
You have to know the image width, adjust the text positions below the image using photoshop (you should use the same font & size you are using on the website).
Adjust the margins of your spans to center the text manually.

AngularJS wait to compile/link/repeat until user clicks

I'm experiencing some performance issues on a medium-sized result set. The result set is a list of documents, each with a small array of properties (metadata like created, modified, tags, owner_name, etc.) that is hidden until the user clicks a show/hide button.
In the template, I'm using a lot of ng-shows, and when I comment all of these out, the performance improves dramatically, so I was wondering if there is a way to ask Angular not to compile any of this, not to render any of the ng-repeats until the user clicks the properties show/hide button. Or is there a more idiomatic way of going about this?
Update: actually, it isn't when I comment out the ng-shows, it seems to be when I comment out the entire block of html, making it seem like accessing properties of an object is the cause of the performance hit. Why?
Template:
<div class="property" ng-show="property.display && property.value && property.viewable" ng-repeat="property in item.properties()">
<span class="property-name">{{property.external}}:</span>
<span class="property-value" ng-show="property.type == 'string' || property.type == 'integer' || property.type == 'float'">
<span ng-hide="property.edit">{{property.value}}</span>
<span ng-show="property.edit">
<input name="{{property.internal}}" id="{{property.internal}}{{item.id()}}" />
<span class="edit-button"><a ng-click="simpleUpdate(item, property)">save</a></span>
<span class="edit-button"><a ng-click="editProperty(item, property)">cancel</a></span>
</span>
<span class="edit-button" ng-show="property.editable && !property.edit"><a ng-click="editProperty(item, property)">edit</a></span>
</span>
<span class="property-value" ng-show="property.type == 'stringArray'">
<span ng-hide="property.edit">{{property.value | join:', '}}</span>
<span ng-show="property.edit">
<textarea name="{{property.internal}}" id="{{property.internal}}{{item.id()}}" class="keywords" rows="1" cols="80"></textarea>
<span class="edit-button"><a ng-click="simpleUpdate(item, property)">save</a></span>
<span class="edit-button"><a ng-click="editProperty(item, property)">cancel</a></span>
</span>
<span class="edit-button" ng-show="property.editable && !property.edit"><a ng-click="editProperty(item, property)">edit</a></span>
</span>
<div class="clearboth"> </div>
</div>

Resources