kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

  • Mood:
  • Music:

marquee component

my third tutorial.

i made a tutorial for a seemingly cross-browser marquee.
stick this inside your print_free_text(Page p)
thanks to bring_me_sugar for the inspiration. ^_^
and...
for those of us who are making these tutorials, i have come up with a nifty convention for variables.
the first part (k1) is something that abbreviates your username.
the second part (MQ) is something that abbreviates what the tutorial does.
the third part (title) is the name that you woulda used in the first place.
and you come up with something like k1MQtitle ... yayness. ^_^
###################################
#         MARQUEE COMPONENT       #
# kunzite1, component-help/189900 #
# add to print_free_text(Page p)  #
##################################################
# Marquee component                              #
# Tutorialized by kunzite1                       #
# Inspirialized by bring_me_sugar                #
##################################################
# MARQUEE START #
#################
# This is the title of the component             #
var string k1MQtitle       = "marquee";
                                                 #
# This is the height of the marquee              #
var string k1MQheight       = "250";
                                                 #
# This is the width of the marquee               #
var string k1MQwidth        = "";
                                                 #
# This is the css class to attach to the marquee #
var string k1MQclass        = "marquee";
                                                 #
# This is the direction of the marquee           #
var string k1MQdirection    = "up";
                                                 #
# This is the speed of the marquee               #
var int    k1MQscrollamount = 2;
##################################################
                                                 
print_comp_header("$k1MQtitle");
var string k1MQmarqueeBegin = "<marquee";
var string k1MQmarqueeEnd   = "</marquee>";

var string k1MQscrollamountString = $k1MQscrollamount + "";
if($k1MQheight != ""){
  $k1MQmarqueeBegin = $k1MQmarqueeBegin + " height='$k1MQheight'";
}
if($k1MQwidth != ""){
  $k1MQmarqueeBegin = $k1MQmarqueeBegin + " width='$k1MQwidth'";
}
if($k1MQclass != ""){
  $k1MQmarqueeBegin = $k1MQmarqueeBegin + " class='$k1MQclass'";
}
if($k1MQdirection != ""){
  $k1MQmarqueeBegin = $k1MQmarqueeBegin + " direction='$k1MQdirection'";
}
if($k1MQscrollamountString != ""){
  $k1MQmarqueeBegin = $k1MQmarqueeBegin + " scrollamount='$k1MQscrollamountString'";
}
$k1MQmarqueeBegin = $k1MQmarqueeBegin + ">";

# this is where you put the stuff that you want to marquee
# in between $k1MQmarqueeBegin and $k1MQmarqueeEnd
# it currently has the default userpic of the currently viewed journal
"""
$k1MQmarqueeBegin
  <p>
    <center>
      $p.journal.default_pic
    </center>
  </p>
$k1MQmarqueeEnd
""";
print_comp_footer();
###############
# MARQUEE END #
###############
Tags: !tutorial, *account level: paid/perm, function: print_free_text, user: kunzite1
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 71 comments