Browse Source

Allow adding additional css files to the embedded html

Useful for using, (for example) fontawesome icons for hotspots
pull/12/head
Guillaume de Bure 10 years ago
parent
commit
ad5b4ff7b5
3 changed files with 17 additions and 4 deletions
  1. +1
    -0
      examples/example-video.htm
  2. +13
    -4
      examples/example-video.json
  3. +3
    -0
      src/js/pannellum.js

+ 1
- 0
examples/example-video.htm View File

@@ -3,6 +3,7 @@
<head> <head>
<title>pannellum embed example</title> <title>pannellum embed example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head> </head>
<body> <body>
<iframe title="pannellum panorama viewer" width="480" height="390" webkitAllowFullScreen mozallowfullscreen allowFullScreen style="border-style:none;" src="../src/pannellum.htm?tour=../examples/example-video.json"></iframe> <iframe title="pannellum panorama viewer" width="480" height="390" webkitAllowFullScreen mozallowfullscreen allowFullScreen style="border-style:none;" src="../src/pannellum.htm?tour=../examples/example-video.json"></iframe>


+ 13
- 4
examples/example-video.json View File

@@ -2,7 +2,8 @@
"default": { "default": {
"author": "Matthew Petroff", "author": "Matthew Petroff",
"firstScene": "pond", "firstScene": "pond",
"autoload": "yes"
"autoload": "yes",
"css": "/font-awesome/css/font-awesome.min.css"
}, },
"scenes": { "scenes": {
@@ -56,11 +57,19 @@
}, },
{ {
"pitch":0, "pitch":0,
"yaw": -120,
"text": "Video Test ",
"type": "info",
"yaw": 0,
"text": "Video Test",
"type": "fa fa-camera",
"video": "../examples/big_buck_bunny_480p_h264.mov", "video": "../examples/big_buck_bunny_480p_h264.mov",
"width":200 "width":200
},
{
"pitch":0,
"yaw": 30,
"text": "Image Test",
"type": "fa fa-photo",
"image": "http://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/Jordan_Pond_Maine.JPG/1024px-Jordan_Pond_Maine.JPG",
"width":200
} }
] ]
} }


+ 3
- 0
src/js/pannellum.js View File

@@ -667,6 +667,9 @@ function processOptions() {
document.getElementById('author_box').innerHTML = 'by ' + config[key]; document.getElementById('author_box').innerHTML = 'by ' + config[key];
document.getElementById('panorama_info').style.display = 'inline'; document.getElementById('panorama_info').style.display = 'inline';
break; break;
case 'css':
document.head.innerHTML = document.head.innerHTML + '<link type="text/css" rel="Stylesheet" href="' + config[key] + '" />'
case 'popout': case 'popout':
if(config[key] == 'yes') { if(config[key] == 'yes') {


Loading…
Cancel
Save