How to display Tinybox 2 popup box on blogger? - popup

I'm using this code to display Tinybox popup box
<script type="text/javascript">
window.onload = function()
{
TINY.box.show(html:'Hello', 1, 400, 350, 1)
}
</script>
Insteed of plan text 'Hello' I want to show text designed in html and css ,
on website i can show html page using this
TINY.box.show('contentfile.html', 1, 400, 350, 1)
But how can i do this in blogger because?

You can host .html file on other site like
<script type="text/javascript">
window.onload = function()
{
TINY.box.show('http://exapmle.com/contentfile.html', 1, 400, 350, 1)
}
</script>

Related

Hide a row (aka series) in Google chart

Is there please a possibility to blend out (hide) a line in Google Line Chart?
We have many line charts with multiple series of close data values and my boss asks me to add a way to hide a series (preferably by clicking the line or the legend with a mouse).
I have added a select event listener to my very simple test case below (just open it in a browser and it will work), but I'm not sure what to do next:
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart']}]}"></script>
<script type="text/javascript">
var data = {"L_B8_ACLR_50_0_QPSK_1_H":{"rows":[
{"c":[{"v":"UTRA_1_DOWN"},{"v":-42.9},{"v":-42.4},{"v":-80},{"v":-35}]},
{"c":[{"v":"E-UTRA_1_DOWN"},{"v":-49.4},{"v":-39.9},{"v":-80},{"v":-32}]},
{"c":[{"v":"E-UTRA_1_UP"},{"v":-48.9},{"v":-48.6},{"v":-80},{"v":-32}]},
{"c":[{"v":"UTRA_1_UP"},{"v":-49.5},{"v":-49.4},{"v":-80},{"v":-35}]},
{"c":[{"v":"UTRA_2_UP"},{"v":-58.9},{"v":-58.9},{"v":-80},{"v":-38}]}],
"cols":[{"p":{"role":"domain"},"label":"MEASUREMENT","type":"string"},
{"p":{"role":"data"},"label":"Row A","type":"number"},
{"p":{"role":"data"},"label":"Row B","type":"number"},
{"p":{"role":"interval"},"label":"LSL","type":"number"},
{"p":{"role":"interval"},"label":"USL","type":"number"}]}};
function drawCharts() {
for (var csv in data) {
var x = new google.visualization.DataTable(data[csv]);
var options = {
title: csv,
width: 800,
height: 600
};
var chart = new google.visualization.LineChart(document.getElementById(csv));
google.visualization.events.addListener(chart, 'select', selectHandler);
chart.draw(x, options);
}
}
function selectHandler(e) {
alert('How to hide a row in the chart?');
}
$(function() {
google.setOnLoadCallback(drawCharts);
});
</script>
</head>
<body>
<div id="L_B8_ACLR_50_0_QPSK_1_H"></div>
</body>
</html>

fancybox onload

I would like to load my fancybiox iframe when the page is loaded:
<script type="text/javascript">
$(document).ready(function(){
$("a.various2").fancybox({
padding: 0,
margin: 0,
width: 400,
height: 350,
autoSize : true,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
});
</script>
</head>
<body>
<a class="various2" data-fancybox-type="iframe" href="nlpumc.html">Iframe</a>
This script works by clicking on the link. But how does it work with document ready? I testet:
$("a.various2").fancybox.open({
That's not correct?
Thank you!
Here's the HTML...
<a class="fancybox" href="http://fancyapps.com/fancybox/demo/1_b.jpg"><img src="http://fancyapps.com/fancybox/demo/1_s.jpg" alt=""/></a>
<a class="fancybox" href="http://fancyapps.com/fancybox/demo/2_b.jpg"><img src="http://fancyapps.com/fancybox/demo/2_s.jpg" alt=""/></a>
And here's the JS...
// Activate fancyBox
$(".fancybox")
.attr('rel', 'gallery')
.fancybox({
padding : 0
});
// Launch fancyBox on first element
$(".fancybox").eq(0).trigger('click');
And now the JSFiddle...
Click here.
Works like a charm!

Tabs Resize Doesn't Work

I've tried several snippets of code I've found from various sources, including Facebook itself and stackoverflow, but none of them work to increase the default length of the custom tabs I created for a client. I've listed the methods I've tried below.
One variable I haven't been able to play with is the Canvas Height setting described on Facebook's FB.Canvas.setSize page. It is nowhere to be found on my App Dashboard. http://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/
It says: "Note: this method is only enabled when Canvas Height is set to "Settable (Default: 800px)" in the App Dashboard."
And here are the various methods I've tried to resize.
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '215615521792601', status: true, cookie: true, xfbml: true});
<!-- EACH OF THESE THREE LINES BELOW WAS TRIED ONE AT A TIME.-->
FB.Canvas.setAutoResize(true);
// FB.Canvas.setAutoGrow(true);
// FB.Canvas.setSize({ width: 520, height: 1576 });
};
And here is another method I found:
<!-- FACEBOOK TAB LENGTH FIX HEADER START -->
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<!-- FACEBOOK TAB LENGTH FIX HEADER END -->
<!-- FACEBOOK TAB LENGTH FIX BODY START -->
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.Canvas.setAutoResize( 100 );
}
// Do things that will sometimes call sizeChangeCallback()
function sizeChangeCallback() {
FB.Canvas.setSize({ width: 520, height: 2400 });
}
</script>
<!-- FACEBOOK TAB LENGTH FIX BODY END -->
Thanks for any and all help! I'm completely stumped and frustrated!
Canvas Height option is available in "App on Facebook" section under Basic Settings in App Dashboard.

Google Visualization API inside YUI3 Sandbox

I am using YUI3 as the javascript framework for my application which is about 90% complete. I need to show some pretty charts, but YUI3's charting capabilities leaves a lot to be desired.
I am trying to use Google's Visualization API to generate plots within YUI3 sandbox but it seems to not be working. Here is the sample code:
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript' src = 'build/yui/yui-min.js'></script>
</head>
<body>
<div id='chart_div'></div>
</body>
</html>
<script type='text/javascript'>
var some_foo = function () {
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Memory', 80],
['CPU', 55],
]);
var options = {
width: 400, height: 120,
redFrom: 90, redTo: 100,
yellowFrom:75, yellowTo: 90,
minorTicks: 5
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
}
}
YUI().use('node', function (Y) {
/* doing some super-awesome stuff */
/* now trying to show charts with some data */
some_foo();
});
</script>
When I place the call to some_foo() outside the YUI3 sandbox, the code works. However, when I try to call it from within YUI3, it does not work.
I have also tried declaring some_foo() within YUI3 sandbox, outside YUI3 sandbox, before YUI3 sandbox, and also after YUI3 sandbox. I have tried the code on FF14+ and Chrome20+.
Is there something I am missing?
#KingJulian, not sure if you already have the answer by now. I moved the google.load('visualization', '1', {packages:['gauge']}); from the "some_foo" function to a "script" tag and it worked.
Following code worked for me:
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script src="http://yui.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
</head>
<body>
<div id='chart_div'></div>
</body>
</html>
<script type="text/javascript">
google.load('visualization', '1', {packages:['gauge']});
</script>
<script type='text/javascript'>
var some_foo = function () {
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Memory', 80],
['CPU', 55],
]);
var options = {
width: 400, height: 120,
redFrom: 90, redTo: 100,
yellowFrom:75, yellowTo: 90,
minorTicks: 5
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
}
}
YUI().use('node', function (Y) {
some_foo();
});
</script>

Zingchart click event handling

I am not sure where to put following zingchart click event handling code in the html page.
zingchart.click = function(dataStr){
var data = eval('(' + dataStr + ')');
alert("Chart Clicked - ID: " + data["id"]);
}
If anybody knows please provide the sample HTML code.
The zingchart.click function can go anywhere after the zingchart script include.
Here is an example:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="../zingchart-1.1.min.js"></script>
</head>
<body>
<div>
<div>
<div id="zingchart"></div>
</div>
<script type="text/javascript">
var jsonConfig = '{"graphset" : [{"type" : "line","series" : [{"values" : [5, 10, 15, 5, 10, 5]}] }]}';
zingchart.render({
data : jsonConfig,
width : 600,
height : 300,
container : 'zingchart'
});
zingchart.click = function(data){
alert("Chart Clicked - ID: " + data["id"]);
}
</script>
</div>
</body>
</html>