Hi... agian,
Geez, sorry for the flood of problems lately, but I'm such a noob.聽聽
SO, I tried to change the toolbar icons, but as usually, I must have messed up something.
In the end, I changed so many things, they don't work and 2 icons can be seen for 1 button at the same time.聽聽
Codes I use:
Any tips to make them work properly?
In addition, could a hover effect be added to them?聽http://ianlunn.github.io/Hover/ (Radial In - (#23799c))
Thanks in advance!聽聽
Geez, sorry for the flood of problems lately, but I'm such a noob.聽聽
SO, I tried to change the toolbar icons, but as usually, I must have messed up something.
In the end, I changed so many things, they don't work and 2 icons can be seen for 1 button at the same time.聽聽
Codes I use:
- JS:
- Code:
$(function() {
聽var share = {
聽
聽 聽text : 'Megoszt谩s',
聽 聽buttons : {
聽 聽 聽/* DEFAULT SHARE BUTTONS */
聽 聽 聽fb : {
聽 聽 聽 聽enable : true,
innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/fbi_1.png" />',
聽 聽 聽 聽title : 'Megoszt谩s Facebookon'
聽 聽 聽},
聽 聽
聽 聽 聽twitter : {
聽 聽 聽 聽enable : true,
innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/twiti_1.png" />',
聽 聽 聽 聽title : 'Megoszt谩s Twitteren'
聽 聽 聽},
聽 聽
聽 聽 聽gp : {
聽 聽 聽 聽enable : true,
innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/gpu_1.png" />',
聽 聽 聽 聽title : 'Megoszt谩s Google Pluson'
聽 聽 聽},
聽 聽
聽 聽 聽mail : {
聽 聽 聽 聽enable : true,
innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/emil_1.png" />',
聽 聽 聽 聽title : 'Elk眉ld茅s E-mailben'
聽 聽 聽},
聽 聽
聽 聽 聽rss : {
聽 聽 聽 聽enable : true,
innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/rss_1.png" />',
聽 聽 聽 聽title : 'View this forum\'s RSS feed'
聽 聽 聽},
聽 聽 聽/* START CUSTOM SHARE BUTTONS */
聽 聽
聽 聽 聽/* extra share buttons */
聽 聽 聽pinterest : {
聽 聽 聽 聽enable : true,
聽 聽 聽 聽innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/pinte_1.png" />',
聽 聽 聽 聽title : 'Megoszt谩s Pinteresten',
聽 聽 聽
聽 聽 聽 聽onclick : function(e) {
聽 聽 聽 聽 聽var media = prompt('You\'re about to pin this page. Share an image ?');
聽 聽 聽 聽
聽 聽 聽 聽 聽if (media == null) return false;
聽 聽 聽 聽 聽else if (media == '') media = $('meta[property="og:image"]').attr('content') || '';
聽 聽 聽 聽
聽 聽 聽 聽 聽window.open('http://pinterest.com/pin/create/button/?url=' + encodeURIComponent(window.location.href) + (media ? '&media=' + encodeURIComponent(media) : '') + '&description=' + encodeURIComponent(document.title), '', 'menubar=no,status=no,scrollbars=no,width=800,height=600');
聽 聽 聽 聽 聽e.preventDefault();
聽 聽 聽 聽}
聽 聽 聽},
聽 聽
聽 聽 聽tumblr : {
聽 聽 聽 聽enable : false,
聽 聽 聽 聽innerHTML : '<img src="http://i21.servimg.com/u/f21/18/21/41/30/tumblr11.png" />',
聽 聽 聽 聽title : 'Megoszt谩s Tumblren',
聽 聽 聽
聽 聽 聽 聽onclick : function(e) {
聽 聽 聽 聽 聽window.open('http://www.tumblr.com/share/link?url=' + encodeURIComponent(window.location.href), '', 'menubar=no,status=no,scrollbars=no,width=800,height=600');
聽 聽 聽 聽 聽e.preventDefault();
聽 聽 聽 聽}
聽 聽 聽},
聽 聽
聽 聽 聽reddit : {
聽 聽 聽 聽enable : true,
聽 聽 聽 聽innerHTML : '<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/redi_1.png" />',
聽 聽 聽 聽title : 'Megoszt谩s Redditen',
聽 聽 聽
聽 聽 聽 聽onclick : function(e) {
聽 聽 聽 聽 聽window.open('http://www.reddit.com/submit?url=' + encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title), '', 'menubar=no,status=no,scrollbars=no,width=800,height=600');
聽 聽 聽 聽 聽e.preventDefault();
聽 聽 聽 聽}
聽 聽 聽},
聽 聽
聽 聽 聽/* misc buttons */
聽 聽 聽print : {
聽 聽 聽 聽enable : false,
聽 聽 聽 聽innerHTML : '<img src="http://i21.servimg.com/u/f21/18/21/60/73/print11.png" />',
聽 聽 聽 聽title : 'Nyomtat谩s',
聽 聽 聽
聽 聽 聽 聽onclick : function(e) {
聽 聽 聽 聽 聽window.print();
聽 聽 聽 聽 聽e.preventDefault();
聽 聽 聽 聽}
聽 聽 聽},
聽 聽
聽 聽 聽copy_url : {
聽 聽 聽 聽enable : false,
聽 聽 聽 聽innerHTML : '<img src="http://i21.servimg.com/u/f21/18/21/41/30/link10.png" />',
聽 聽 聽 聽title : 'Copy BBCode URL',
聽 聽 聽
聽 聽 聽 聽onclick : function(e) {
聽 聽 聽 聽 聽prompt('Copy the BBCode URL of this page ?', '[url=' + window.location.href + ']' + document.title + '[/url]');
聽 聽 聽 聽 聽e.preventDefault();
聽 聽 聽 聽}
聽 聽 聽},
聽 聽
聽 聽 聽top : {
聽 聽 聽 聽enable : false,
聽 聽 聽 聽innerHTML : '<img src="http://i21.servimg.com/u/f21/18/21/41/30/top10.png" />',
聽 聽 聽 聽title : 'Top of the page',
聽 聽 聽 聽href : '#top'
聽 聽 聽},
聽 聽
聽 聽 聽bottom : {
聽 聽 聽 聽enable : false,
聽 聽 聽 聽innerHTML : '<img src="http://i21.servimg.com/u/f21/18/21/41/30/bottom11.png" />',
聽 聽 聽 聽title : 'Bottom of the page',
聽 聽 聽 聽href : '#bottom'
聽 聽 聽}
聽 聽 聽/* END CUSTOM SHARE BUTTONS*/
聽 聽}
聽},
聽newList = document.createElement('SPAN'),
聽fa_share,
聽fa_share_text,
聽existingNode,
聽newNode,
聽i, k;
聽$(function() {
聽 聽fa_share = document.getElementById('fa_share');
聽 聽fa_share_text = document.getElementById('fa_share_text');
聽 聽if (!fa_share) return;
聽
聽 聽// apply new share text
聽 聽if (fa_share_text) fa_share_text.innerHTML = share.text + ' : ';
聽 聽// redefine share buttons
聽 聽for (i in share.buttons) {
聽 聽 聽existingNode = document.getElementById('fa_' + i);
聽 聽 聽// modify exisiting share buttons
聽 聽 聽if (existingNode) {
聽 聽 聽 聽if (share.buttons[i].enable) {
聽 聽 聽 聽 聽for (k in share.buttons[i]) if (k != 'enable') existingNode[k] = share.buttons[i][k];
聽 聽 聽 聽 聽newList.appendChild(existingNode);
聽 聽 聽 聽}
聽 聽 聽 聽else existingNode.parentNode.removeChild(existingNode);
聽 聽 聽}
聽 聽
聽 聽 聽// create a new share button
聽 聽 聽else if (share.buttons[i].enable) {
聽 聽 聽 聽newNode = document.createElement('A');
聽 聽 聽 聽newNode.id = 'fa_' + i;
聽 聽 聽
聽 聽 聽 聽for (k in share.buttons[i]) if (k != 'enable') newNode[k] = share.buttons[i][k];
聽 聽 聽 聽if (!newNode.href) newNode.href = '#';
聽 聽 聽
聽 聽 聽 聽newList.appendChild(newNode);
聽 聽 聽}
聽 聽}
聽 聽fa_share.appendChild(newList);
聽});
});
- CSS:
- Code:
#fa_pinterest {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/pinte_1.png');
}
#fa_fb {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/fbi_1.png');
}
#fa_twitter {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/twiti_1.png');
}
#fa_gp {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/gpu_1.png');
}
#fa_mail {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/emil_1.png');
}
#fa_rss {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/rss_1.png');
}
#fa_reddit {
聽width:25px;
聽height:25px;
聽background-image:url('http://i1370.photobucket.com/albums/ag257/AppleDrink/redi_1.png');
}
Any tips to make them work properly?
In addition, could a hover effect be added to them?聽http://ianlunn.github.io/Hover/ (Radial In - (#23799c))
Thanks in advance!聽聽
Last edited by Mim贸za on December 20th 2015, 4:10 pm; edited 1 time in total